File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Most efficient way of implementing zoom in/out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Most efficient way of implementing zoom in/out" Watch "Most efficient way of implementing zoom in/out" New topic
Author

Most efficient way of implementing zoom in/out

Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
It's been done to death and I know there's any number of ways to do it but I'm wondering without getting too complicated what's the most efficient approach to this?
Daniel Puryear
Greenhorn

Joined: Jun 02, 2002
Posts: 22
Use the AffineTransform of the Graphics2D. Basically you set you clip region (your components drawable area), then scale up/down, and the clip handles the rest.
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
Keep in mind I'm doing this with very big TIFF files, in fact the one I'm manipulating right now is 24 megs. How do you avoid OutOfMemory errors using that method?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Most efficient way of implementing zoom in/out