LEADTOOLS Windows Forms (Leadtools.WinForms assembly)

RasterViewerInteractiveMode Enumeration

Show in webframe
ExampleExample 





Values for the RasterImageViewer.InteractiveMode property.
Syntax
public enum RasterViewerInteractiveMode : System.Enum, System.IComparableSystem.IConvertibleSystem.IFormattable  
'Declaration
 
Public Enum RasterViewerInteractiveMode 
   Inherits System.Enum
   Implements System.IComparableSystem.IConvertibleSystem.IFormattable 
'Usage
 
Dim instance As RasterViewerInteractiveMode

            

            
public enum class RasterViewerInteractiveMode : public System.Enum, System.IComparableSystem.IConvertibleSystem.IFormattable  
Members
ValueMemberDescription
0x00000000NoneDefault, no user interaction.
0x00000001PanAllows the user to pan the image using the mouse.
0x00000002CenterAtCenters the image at the mouse coordinates for the last user click. This will call the RasterImageViewer.CenterAtPoint method.
0x00000003ZoomToZooms the image to the rectangle created by the user.
0x00000004Region

Creates a region based on user interaction.

The type of region created depends on the RasterImageViewer.InteractiveRegionType property.

0x00000005MagnifyGlassStarts the MagnifyGlass.
0x00000006FloaterStarts moving the RasterImageViewer.FloaterImage.
0x00000007PageAllows the user to change the current page in the image using the mouse.
0x00000008ScaleAllows the user to change the current scale factor of the image using the mouse.
0x00000009UserRectangleUser-defined rectangle. You should subscribe to the RasterImageViewer.InteractiveUserRectangle event to add your custom code to handle the rectangle drawn.
Remarks
The RasterImageViewer.InteractiveMode property controls user interaction with the control's display.
Example
Copy Code  
Imports Leadtools.WinForms
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Drawing

Private Shared Sub RasterViewerInteractiveModeExample(ByVal viewer As RasterImageViewer)
   ' Make sure the viewer size mode is normal
   viewer.SizeMode = RasterPaintSizeMode.Normal
   ' Set interactive mode to ZoomAt
   viewer.InteractiveMode = RasterViewerInteractiveMode.ZoomAt;

   ' Set the center at scale factor to 1, so zoom in twice with each click
   viewer.CenterZoomAtPointScaleFactor = 2.0

   AddHandler viewer.InteractiveModeEnded, AddressOf viewer_InteractiveModeEnded;
End Sub

Private Shared Sub viewer_InteractiveModeEnded(ByVal sender As Object, ByVal e As EventArgs)
   ' Check if this is the Center At interactive mode
   Dim viewer As RasterImageViewer = CType(sender, RasterImageViewerExamples)
   If viewer.InteractiveMode = RasterViewerInteractiveMode.ZoomAt Then
      If viewer.CenterZoomAtPointScaleFactor = 2.0 Then
         ' Switch the scale factor to 0.5, so next time we click, it will zoom out twice
         viewer.CenterZoomAtPointScaleFactor = 0.5
      Else
         ' Back to 2, so we zoom in
         viewer.CenterZoomAtPointScaleFactor = 2.0
      End If
   End If
End Sub
using Leadtools.WinForms;
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Color;
using Leadtools.Drawing;

private static void RasterViewerInteractiveModeExample(RasterImageViewer viewer)
{
   // Make sure the viewer size mode is normal
   viewer.SizeMode = RasterPaintSizeMode.Normal;
   // Set interactive mode to ZoomAt
   viewer.InteractiveMode = RasterViewerInteractiveMode.ZoomAt;

   // Set the center at scale factor to 1, so zoom in twice with each click
   viewer.CenterZoomAtPointScaleFactor = 2.0;

   viewer.InteractiveModeEnded += viewer_InteractiveModeEnded;
}
private static void viewer_InteractiveModeEnded(object sender, EventArgs e)
{
   // Check if this is the Center At interactive mode
   RasterImageViewer viewer = sender as RasterImageViewer;
   if (viewer.InteractiveMode == RasterViewerInteractiveMode.ZoomAt)
   {
      if (viewer.CenterZoomAtPointScaleFactor == 2.0)
      {
         // Switch the scale factor to 0.5, so next time we click, it will zoom out twice
         viewer.CenterZoomAtPointScaleFactor = 0.5;
      }
      else
      {
         // Back to 2, so we zoom in
         viewer.CenterZoomAtPointScaleFactor = 2.0;
      }
   }
}
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         Leadtools.WinForms.RasterViewerInteractiveMode

Requirements

Target Platforms

See Also

Reference

Leadtools.WinForms Namespace

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.