wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes image zoom Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "image zoom" Watch "image zoom" New topic
Author

image zoom

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I want to zoom in an image. I want user to click a point in the image, then I need to enlarge the image based on the point user click. That point should be the center in the new enlarged image.

How could I do that ?

Thanks
Lou Pelagalli
Ranch Hand

Joined: Nov 11, 2003
Posts: 150
    
    1
The ButtonSizing class posted by Craig Wood may help get you started, particularly method private Image getScaledImage(BufferedImage image, double scale).
http://www.coderanch.com/t/338181/GUI/java/JButton-ImageIcon-Size

Add on a MouseListener to get the MouseEvent and you should be able to size your image from the x/y of the click from the MouseEvent.

Hope it works for you.

Lou
 
jQuery in Action, 2nd edition
 
subject: image zoom
 
Similar Threads
image zoom-in
Resize Image Icon
zooming in
General Question Regarding Image Processing
Image resizing