Leadtools.WinForms Namespace : RasterViewerInteractiveMode Enumeration |
public enum RasterViewerInteractiveMode : System.Enum, System.IComparable, System.IConvertible, System.IFormattable
'Declaration Public Enum RasterViewerInteractiveMode Inherits System.Enum Implements System.IComparable, System.IConvertible, System.IFormattable
'Usage Dim instance As RasterViewerInteractiveMode
public enum class RasterViewerInteractiveMode : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable
Value | Member | Description |
---|---|---|
0x00000000 | None | Default, no user interaction. |
0x00000001 | Pan | Allows the user to pan the image using the mouse. |
0x00000002 | CenterAt | Centers the image at the mouse coordinates for the last user click. This will call the RasterImageViewer.CenterAtPoint method. |
0x00000003 | ZoomTo | Zooms the image to the rectangle created by the user. |
0x00000004 | Region |
Creates a region based on user interaction. The type of region created depends on the RasterImageViewer.InteractiveRegionType property. |
0x00000005 | MagnifyGlass | Starts the MagnifyGlass. |
0x00000006 | Floater | Starts moving the RasterImageViewer.FloaterImage. |
0x00000007 | Page | Allows the user to change the current page in the image using the mouse. |
0x00000008 | Scale | Allows the user to change the current scale factor of the image using the mouse. |
0x00000009 | UserRectangle | User-defined rectangle. You should subscribe to the RasterImageViewer.InteractiveUserRectangle event to add your custom code to handle the rectangle drawn. |
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; } } }
System.Object
System.ValueType
System.Enum
Leadtools.WinForms.RasterViewerInteractiveMode