How do I draw in a zoom mode on a small section of image?

Is PGraphics the best way to work with an oversize image that you want to zoom into to? If so, can I work with an offset version of this, and draw directly in the display window? How do I map x,y values from display screen to the oversize image? Is this automatic, or do I have to calculate the proper coordinates?

thanks

Answers

  • Answer ✓

    You could do it yourself (pgraphics is good, yes) or you could look at the foldingmaps library

  • Answer ✓

    @koogs meant to say unfolding maps :-B

    If you use PGraphics, then when you zoom in/out, you will need to calculate the transformations for positions as well. For example, mouse position will need to be mapped. I believe you should be able to find related posts in the forum: https://forum.processing.org/two/search?Search=panning

    There is a Mouse 2D Transformations that does some mouse transformations for you after you translate, scale and rotate your image. You can install it using the Lib manager in Processing and check the provided examples.

    Kf

  • edited November 2017 Answer ✓

    folding / unfolding ¯\_(ツ)_/¯

  • Thanks koogs and kfrajer. I'll go off and study your links and apply what is appropriate.

Sign In or Register to comment.