Leadtools.Windows.Controls Send comments on this topic. | Back to Introduction - LEADTOOLS WPF | Help Version 16.5.9.25
InteractiveZoomTo Event
See Also  Example
Leadtools.Windows.Controls Namespace > BitmapSourceViewer Class : InteractiveZoomTo Event





Occurs when the user interacts with the center of the image display.

Syntax

Visual Basic (Declaration) 
Public Event InteractiveZoomTo() As InteractiveZoomToEventHandler
Visual Basic (Usage)Copy Code
Dim instance As BitmapSourceViewer
Dim handler As InteractiveZoomToEventHandler
 
AddHandler instance.InteractiveZoomTo, handler
C# 
public event InteractiveZoomToEventHandler InteractiveZoomTo()
C++/CLI 
public:
event InteractiveZoomToEventHandler^ InteractiveZoomTo();
XAML Attributes Usage 

<object InteractiveZoomTo=EventHandler<ExceptionRoutedEventArgs>/> ...

Routed Event Information 

Identifier field

InteractiveZoomToEvent

Routing strategy

Bubbling

Delegate

InteractiveZoomToEventHandler

XAML Attributes Usage 

<object InteractiveZoomTo=EventHandler<ExceptionRoutedEventArgs>/> ...

Routed Event Information 

Identifier field

InteractiveZoomToEvent

Routing strategy

Bubbling

Delegate

InteractiveZoomToEventHandler

Example

This example zooms the image when dragging a rectangle on the image. Also, it displays the contents of the InteractiveZoomTo event in the console.

Visual BasicCopy Code
Private Sub viewer_InteractiveZoomTo(ByVal sender As Object, ByVal e As BitmapSourceViewerRectangleEventArgs)
    Console.WriteLine("InteractiveZoomTo: e.Rectangle {0}, e.Status {1}, e.Cancel {2}", e.Rectangle, e.Status, e.Cancel)
End Sub
Public Sub BitmapSourceViewer_InteractiveZoomTo(ByVal viewer As BitmapSourceViewer)
    viewer.InteractiveMode = BitmapSourceViewerInteractiveMode.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 BitmapSourceViewer.InteractiveZoomToEventHandler(viewer_InteractiveZoomTo);
End Sub
C#Copy Code
private void viewer_InteractiveZoomTo(object sender, BitmapSourceViewerRectangleEventArgs e) 

   Console.WriteLine("InteractiveZoomTo: e.Rectangle {0}, e.Status {1}, e.Cancel {2}", e.Rectangle, e.Status, e.Cancel); 

public void BitmapSourceViewer_InteractiveZoomTo(BitmapSourceViewer viewer) 

   viewer.InteractiveMode = BitmapSourceViewerInteractiveMode.ZoomTo; 
   viewer.InteractiveZoomTo += new InteractiveZoomToEventHandler(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 BitmapSourceViewer.InteractiveZoomToEventHandler(viewer_InteractiveZoomTo); 
}
XAMLCopy Code
<Window x:Class="WPFSamples.BitmapSourceViewer" Height="600" Width="800" Title="InteractiveZoomTo Sample" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Leadtools_Windows_Controls="clr-namespace:Leadtools.Windows.Controls;assembly=Leadtools.Windows.Controls"> 
  <DockPanel> 
    <Leadtools_Windows_Controls:BitmapSourceViewer Name="theViewer" Source="file:///C:\Program Files\LEAD Technologies\LEADTOOLS 16\Images\slave.jpg" DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Center" InteractiveMode="ZoomTo" InteractiveZoomTo="viewer_InteractiveZoomTo" /> 
  </DockPanel> 
</Window>

Remarks

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

See Also