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

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 ?

Lou Pelagalli
Ranch Hand

Joined: Nov 11, 2003
Posts: 150
The ButtonSizing class posted by Craig Wood may help get you started, particularly method private Image getScaledImage(BufferedImage image, double scale).

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.

Have you checked out Aspose?
subject: image zoom
It's not a secret anymore!