WPF Pan limitation
-
Hi, I did a application (WPF) which has ImageContrl inside a Border, and using mouse we can Zoom and Pan the control. It works fine except that while Panning the image after zoom, it moves out of the viewport of the Border. Can any one throw me light on hw to solve this
-
Hi, I did a application (WPF) which has ImageContrl inside a Border, and using mouse we can Zoom and Pan the control. It works fine except that while Panning the image after zoom, it moves out of the viewport of the Border. Can any one throw me light on hw to solve this
One thing to be aware of when using a ScaleTransform is that it does not affect the size of the element you are scaling. If you are panning your object by a value that corresponds to the ActualWidth/Height then it might explain why it is panning incorrectly. Perhaps multiply the scale amount with your ActualWidth/Height to get its 'real' screen dimensions. Cheers, Daniel
Daniel Vaughan Twitter | Blog | Microsoft MVP | Projects: Calcium SDK, Clog | LinkedIn
-
One thing to be aware of when using a ScaleTransform is that it does not affect the size of the element you are scaling. If you are panning your object by a value that corresponds to the ActualWidth/Height then it might explain why it is panning incorrectly. Perhaps multiply the scale amount with your ActualWidth/Height to get its 'real' screen dimensions. Cheers, Daniel
Daniel Vaughan Twitter | Blog | Microsoft MVP | Projects: Calcium SDK, Clog | LinkedIn
Good answer Dan. Good to see you here among the mortals. ;)
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
Good answer Dan. Good to see you here among the mortals. ;)
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
Thanks Pete! The awesome work you do on the CP technical forums blows my mind. Cheers, Daniel
Daniel Vaughan Twitter | Blog | Microsoft MVP | Projects: Calcium SDK, Clog | LinkedIn
-
Thanks Pete! The awesome work you do on the CP technical forums blows my mind. Cheers, Daniel
Daniel Vaughan Twitter | Blog | Microsoft MVP | Projects: Calcium SDK, Clog | LinkedIn
Gosh, thanks. Coming from you Dan, that means a heck of a lot. BTW - I've got my preorder in for WP7 Unleashed.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads