Occurs when the user performs interactive zoom to rectangle of the image display.
Supported in Silverlight, Windows Phone 7
Syntax
Event Data
The event handler receives an argument of type RectangleInteractiveEventArgs containing data related to this event. The following RectangleInteractiveEventArgs properties provide information specific to this event.
Example
This example zooms the image when dragging a rectangle on the image. Also, it displays the contents of the ImageViewer.InteractiveZoomTo event in the console.
Visual Basic | Copy Code |
---|
Private Sub viewer_InteractiveZoomTo(ByVal sender As Object, ByVal e As RectangleInteractiveEventArgs)
Console.WriteLine("InteractiveZoomTo: e.Rectangle {0}, e.Status {1}, e.Cancel {2}", e.Bounds, e.Status, e.Cancel)
End Sub
Public Sub BitmapSourceViewer_InteractiveZoomTo(ByVal viewer As ImageViewer)
viewer.InteractiveMode = InteractiveMode.ZoomTo
AddHandler viewer.InteractiveZoomTo, AddressOf viewer_InteractiveZoomTo
MessageBox.Show("Draw a rectangle with the mouse to cause a zoom")
' After you are done, you must remove the event handler as in below
'
' viewer.InteractiveZoomTo -= new ImageViewer.InteractiveZoomToEventHandler(viewer_InteractiveZoomTo);
End Sub |
C# | Copy Code |
---|
private void viewer_InteractiveZoomTo(object sender, RectangleInteractiveEventArgs e)
{
Console.WriteLine("InteractiveZoomTo: e.Rectangle {0}, e.Status {1}, e.Cancel {2}", e.Bounds, e.Status, e.Cancel);
}
public void BitmapSourceViewer_InteractiveZoomTo(ImageViewer viewer)
{
viewer.InteractiveMode = InteractiveMode.ZoomTo;
viewer.InteractiveZoomTo +=new EventHandler<RectangleInteractiveEventArgs>(viewer_InteractiveZoomTo);
MessageBox.Show("Draw a rectangle with the mouse to cause a zoom");
// After you are done, you must remove the event handler as in below
//
// viewer.InteractiveZoomTo -= new ImageViewer.InteractiveZoomToEventHandler(viewer_InteractiveZoomTo);
} |
SilverlightCSharp | Copy Code |
---|
private void viewer_InteractiveZoomTo(object sender, RectangleInteractiveEventArgs e)
{
Console.WriteLine("InteractiveZoomTo: e.Rectangle {0}, e.Status {1}, e.Cancel {2}", e.Bounds, e.Status, e.Cancel);
}
public void BitmapSourceViewer_InteractiveZoomTo(ImageViewer viewer)
{
viewer.InteractiveMode = InteractiveMode.ZoomTo;
viewer.InteractiveZoomTo +=new EventHandler<RectangleInteractiveEventArgs>(viewer_InteractiveZoomTo);
MessageBox.Show("Draw a rectangle with the mouse to cause a zoom");
// After you are done, you must remove the event handler as in below
//
// viewer.InteractiveZoomTo -= new ImageViewer.InteractiveZoomToEventHandler(viewer_InteractiveZoomTo);
} |
SilverlightVB | Copy Code |
---|
Private Sub viewer_InteractiveZoomTo(ByVal sender As Object, ByVal e As RectangleInteractiveEventArgs)
Console.WriteLine("InteractiveZoomTo: e.Rectangle {0}, e.Status {1}, e.Cancel {2}", e.Bounds, e.Status, e.Cancel)
End Sub
Public Sub BitmapSourceViewer_InteractiveZoomTo(ByVal viewer As ImageViewer)
viewer.InteractiveMode = InteractiveMode.ZoomTo
AddHandler viewer.InteractiveZoomTo, AddressOf viewer_InteractiveZoomTo
MessageBox.Show("Draw a rectangle with the mouse to cause a zoom")
' After you are done, you must remove the event handler as in below
'
' viewer.InteractiveZoomTo -= new ImageViewer.InteractiveZoomToEventHandler(viewer_InteractiveZoomTo);
End Sub |
Remarks
Requirements
Target Platforms: Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also