Zoom Fucntion with Graphics 2D


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Zoom Fucntion with Graphics 2D

  1. #1
    Join Date
    Jan 2005
    Posts
    2

    Question Zoom Fucntion with Graphics 2D

    Hi there,

    I'm drawing some lines using Graphics2D and Line2D.Double in a frame. What i would like to do is a type of zoom on this drawing, ie via input box.

    The situation is a i'm drawing a graph type drawing and would like to have the effect of zooming in a a particular section.

    Any Idea's?

    Thanks,

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    Here is an applet that zooms, without any fancy graphics
    manipulation though. It just magnifies by using the
    graphics drawImage method.
    It zooms in on left mouse button and out w. right mouse
    button, and it also scrolls the image. You reset it by
    double mouse click.

    Here is a demo

    All that is needed is to change it to a JPanel and replace
    the image retrieval code. Then it can be stuffed right
    into a JFrame.
    Attached Files Attached Files
    eschew obfuscation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center