Zoom in/out on graphic

Any hints on how to allow the user to zoom in or out on graphic with the two fingers on the screen (not sure what that is called)? Have graphic displayed as an image.

I have no doubt there will be a ‘better way’

I have in the past used a technique like this…

What you describe is ‘pinch zoom’
In the PointerDrag event, you get an array of PointerInfo objects
If there are 2 of them, (If pointerinfo.ubound = 1 ) you can compare the distance between the points when the pointer begins, with the distance between them ‘now’

Distance between = sqrt ( (x diff) * (xdiff) + (ydiff) * (ydiff))
(square on the hypotenuse… etc )

but there is a method for this already:

thisdistance = abs(pointerinfo(0).position.DistanceTo( pointerinfo(1).position))

if the distance gets bigger, zoom in.
If smaller, zoom out.

1 Like

Thanks will give it a shot.