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





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

Syntax

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

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

Routed Event Information 

Identifier field

InteractiveCenterAtEvent

Routing strategy

Bubbling

Delegate

InteractiveCenterAtEventHandler

XAML Attributes Usage 

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

Routed Event Information 

Identifier field

InteractiveCenterAtEvent

Routing strategy

Bubbling

Delegate

InteractiveCenterAtEventHandler

Example

This example lets the user center the image in the window by clicking the mouse. Also, it displays the contents of the InteractiveCenterAt event in the console.

Visual BasicCopy Code
Private Sub viewer_InteractiveCenterAt(ByVal sender As Object, ByVal e As BitmapSourceViewerPointEventArgs)
    Console.WriteLine("InteractiveCenterAt: e.Status {0}, e.Cancel {1}", e.Status, e.Cancel)
End Sub
Public Sub BitmapSourceViewer_InteractiveCenterAt(ByVal viewer As BitmapSourceViewer)
    viewer.InteractiveMode = BitmapSourceViewerInteractiveMode.CenterAt
    AddHandler viewer.InteractiveCenterAt, AddressOf viewer_InteractiveCenterAt

    ' Click mouse on image to see the center the image
    ' After you are done, you must remove the event handler as in below
    '
    ' viewer.InteractiveCenterAt -= new BitmapSourceViewer.InteractiveCenterAtEventHandler(viewer_InteractiveCenterAt);
End Sub
C#Copy Code
private void viewer_InteractiveCenterAt(object sender, BitmapSourceViewerPointEventArgs e) 

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

public void BitmapSourceViewer_InteractiveCenterAt(BitmapSourceViewer viewer) 

   viewer.InteractiveMode = BitmapSourceViewerInteractiveMode.CenterAt; 
   viewer.InteractiveCenterAt += new InteractiveCenterAtEventHandler(viewer_InteractiveCenterAt); 
 
   // Click mouse on image to see the center the image 
   // After you are done, you must remove the event handler as in below 
   // 
   // viewer.InteractiveCenterAt -= new BitmapSourceViewer.InteractiveCenterAtEventHandler(viewer_InteractiveCenterAt); 
}
XAMLCopy Code
<Window x:Class="WPFSamples.BitmapSourceViewer" Height="600" Width="800" Title="InteractiveCenterAt 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="Bottom" InteractiveMode="CenterAt" InteractiveCenterAt="viewer_InteractiveCenterAt" /> 
  </DockPanel> 
</Window>

Remarks

Requirements

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

See Also