Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Most efficient way of implementing zoom in/out

 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic