How can you calculate the X/Y coordinate to zoom to
- by Mark
Im writing a WPF application that has a zoom and pan ability, but what I want to also implement is the ability to zoom and pan "automatically" (via a button click).
I have the methods all defined to zoom and pan, but Im having trouble telling the app the desired X/Y coordinates for the panning.
Basically, I know that I want the control to be centered at a desired zoom level (say zoomed in 6X times), but the panning destination point is NOT the center point of the control because after the zooming, its been scaled.
Does anyone know a way of calculating the desired X/Y position to pan to, taking into account the zooming as well? Do I just scale the desired destination Point? It doesnt seem to work for me...
Thanks a lot