Remove All Ads from XDA

Pinch Zoom Transformations

12 posts
Thanks Meter: 4
By Panthersgba, Junior Member on 9th August 2012, 04:10 PM
Post Reply Email Thread
Hey everyone!

I have been trying to get pinch zoom working in a SurfaceView, and I can get it to detect if a pinch is happening and all, but here is my dilemma.

I am using canvas to draw a grid to the background. The grid is a 2d array of Rect objects, so as I pinch, I change the size of the Rects. My problem is getting it to zoom into the correct area of the grid.

So, my question is how to do the correct transformation on something like this? Is there a way to put an ImageView into the canvas and draw to that? I will post the relevant code when I get home from work later today, but I figured I would post this just to see if anyone had done something similar.

Thanks in advance!
Post Reply Subscribe to Thread

android, canvas, pinch zoom

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes