• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

image zoom-in

 
meera sood
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!
could anybody help me out with image zoom-in and zoom-out. I am making an applet, wherein on the click of a button, the user should be able to zoom-in successively , and on the click of another button, zoom-out of the image successively. if anybody could help me out in this...
thanx in advance..
meera
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never done this.
I'd try to construct a new image of whatever size I am displaying using a clipping region of the original image effectively zooming in on the original image. To zoom in some more, repeat using some clipping region of the new image. To zoom out, either maintain a collection of images and step backwards through them, or use some clipping region from the original image to construct a new image, etc.
For a more sophisticated approach, you might want to see what the group at Koala Graphics did. They provide an open source, high end, 2D graphics package.
Good Luck.
 
Shashi Kanta
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Meera,
try out the following code:

///
hope u got what u want!
rgds,
Shashi
 
Shashi Kanta
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh, by the way, if its too small to see, u just copy and paste in onto wordpad.
rgds,
Shashi
 
meera sood
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx a lot..i tried and it worked!!!
otherwise, i tried using the getScaledInstance() method of java.awt and it also worked.
thanx again...

meera
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic