I have a canvas that is 1080 x 540. It has a 1080x540 .jpg as the back ground (it's an Earth map) and I'm placing icons on it based on Lat/Long coords.
I use scale(0,0,2,2) to zoom in on the icons, and that works. I use zoom on the jpg to keep the map in scale with the icons. That all works great.
So here's my issue- When you zoom in, the origin is 0,0, so the upper left corner stays the upper left corner and everything is pushed off the viewable area of the canvas down and to the right. What I would like to do is zoom in on the center of the viewable area, and push off the visible area equally up/down and left/right. If I have to fake it by zooming about the upper left corner, and then auto scrolling the scroll bars the appropriate number of pixels, I'm pretty cool with that.
How do I do that?
I'm sure it's easy, but I can't seem to get it to work.
Thanks,
I use scale(0,0,2,2) to zoom in on the icons, and that works. I use zoom on the jpg to keep the map in scale with the icons. That all works great.
So here's my issue- When you zoom in, the origin is 0,0, so the upper left corner stays the upper left corner and everything is pushed off the viewable area of the canvas down and to the right. What I would like to do is zoom in on the center of the viewable area, and push off the visible area equally up/down and left/right. If I have to fake it by zooming about the upper left corner, and then auto scrolling the scroll bars the appropriate number of pixels, I'm pretty cool with that.
How do I do that?
I'm sure it's easy, but I can't seem to get it to work.
Thanks,