Move + Zoom

6 views
Skip to first unread message

Harimau

unread,
Oct 12, 2009, 8:08:08 AM10/12/09
to WPF Graphics Site group
Hi there,

I'm just evaluating the ZoomPanel control. It's pretty much doing what
I'm looking for, but I'm kind of stuck right now regarding a
functionality I'm trying to implement using the zoomPanel. The
application I'm developing right now draw some image on a canvas. The
user should be able to zoom in, out and move the image using the muse.
I'd like to implement kind of an "auto-mode". When in this auto mode a
click on the image should center the image on the click position and
zoom in by a defined factor (this is working), the next click should
reset the viewport to display the whole image again (working as well
using "ResetToLimits"). Here's the catch: At the same time it should
be possible to move the image using the mouse when holding down the
left mouse button.

Any hint how to implement this behaviour?

regards

ab3d admin

unread,
Oct 15, 2009, 4:12:57 PM10/15/09
to WPF Graphics Site group
Hi,

After calling ResetToLimits method you can try to call
TranslateToCenter or TranslateToCenterRelative methods.

The methods translates the content of ZoomPanel so that the
mouseNewCenterPoint is shown in the center of ZoomPanel.
The parameter can be in absolute coordinates (TranslateToCenter) or
relative (TranslateToCenterRelative).

Andrej
Reply all
Reply to author
Forward
0 new messages