How to detect when image is clipped to turn panning on
#1
Similar to previous question ...

I am looking at an 1920x1080 image in a ZoomPanel. I am using mouse and touch.

When the image is completely visible, I want to pin it to center position and prevent mouse/touch panning.

When the image is clipped because of zoom in, I want to allow panning to view otherwise hidden pixels.

I can prevent the panning but I cant seem to figure out when the image is clipping to turn panning on and off at the right moment.

Jez
#2
You can check various properties on ZoomPanel to see if you are zooming in or out.

One is ZoomFactor - when it is bigger the 1, then you are zooming in.
The other is Viewbox - when its width and height are smaller than 1, then you are zooming in.

To see examples of the values and some other possible properties check the "ZoomPanelDump" sample under ZoomPanel section.
Andrej Benedik
#3
Thanks for the reply.

When ZoomFactor is 1 the image is not clipped so I can turn off panning completely.

When ZoomFactor is 1.3, the image is clipped at top/bottom but not left/right so I want to allow vertical panning only.

Thats what I am trying to do.

Jez
#4
Hi again,

I have been experimenting with your touch sample with the tiger.

Can you please explain the best way to stop the tiger being dragged around when zoomed out. I want it to be in a fixed position until the zoom level requires panning.

Thanks
  


Forum Jump:


Users browsing this thread:
1 Guest(s)