←Select platform

RasterViewerInteractiveMode Enumeration

Summary

Values for the RasterImageViewer.InteractiveMode property.

Syntax

C#
VB
C++
public enum RasterViewerInteractiveMode : System.Enum, System.IComparable, System.IConvertible, System.IFormattable
Public Enum RasterViewerInteractiveMode  
   Inherits System.Enum 
   Implements System.IComparable, System.IConvertible, System.IFormattable 
public enum class RasterViewerInteractiveMode : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable

Members

ValueMemberDescription
0NoneDefault, no user interaction.
1PanAllows the user to pan the image using the mouse.
2CenterAtCenters the image at the mouse coordinates for the last user click. This will call the RasterImageViewer.CenterAtPoint method.
3ZoomToZooms the image to the rectangle created by the user.
4Region

Creates a region based on user interaction.

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

5MagnifyGlassStarts the MagnifyGlass.
6FloaterStarts moving the RasterImageViewer.FloaterImage.
7PageAllows the user to change the current page in the image using the mouse.
8ScaleAllows the user to change the current scale factor of the image using the mouse.
9UserRectangleUser-defined rectangle. You should subscribe to the RasterImageViewer.InteractiveUserRectangle event to add your custom code to handle the rectangle drawn.
10ZoomAtZooms the image at the mouse coordinates for the last user click. This will call the RasterImageViewer.ZoomAtPoint method with scaleFactor set to RasterImageViewer.CenterZoomAtPointScaleFactor.
Remarks

The RasterImageViewer.InteractiveMode property controls user interaction with the control's display.

Example

This example will set the viewer interactive mode to "ZoomAt", it will also alternate the scale factor used with each click between 2 and 0.5. When you run this example, the first click on the viewer will zoom in the image around that point twice. When you click again, the viewer will zoom out the image around that point twice. Subsequent clicks will repeat these operations.

C#
VB
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, RasterImageViewer) 
   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_ZoomAtInteractiveModeEnded; 
} 
private static void viewer_ZoomAtInteractiveModeEnded(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; 
      } 
   } 
} 

Requirements

Target Platforms

See Also

Reference

Leadtools.WinForms Namespace

Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
Leadtools.WinForms Assembly
Click or drag to resize