<MultiScaleImage x:Name="deepZoomObject" Source="source/dzc_output.xml"
MouseEnter="DeepZoomObject_MouseEnter"
MouseLeave="DeepZoomObject_MouseLeave"/>
private void DeepZoomObject_MouseEnter(object sender, MouseEventArgs e)
{
// The ZoomAboutLogicalPoint method allows you to zoom and pan
// in the same step. The first parameter is the zoom (3x) and the
// third and fourth parameters are the respective x and y coordinates
// of the logical point to zoom around.
this.deepZoomObject.ZoomAboutLogicalPoint(3, .5, .5);
}
private void DeepZoomObject_MouseLeave(object sender, MouseEventArgs e)
{
double zoom = 1;
zoom = zoom / 3;
// This time the zoom is reversed (1/3) although the pan
// remains the same - zoom back out from the middle.
this.deepZoomObject.ZoomAboutLogicalPoint(zoom, .5, .5);
}