Values for the RasterImageViewer.InteractiveMode property.
public enum RasterViewerInteractiveMode Public Enum RasterViewerInteractiveModeInherits System.EnumImplements System.IComparable, System.IConvertible, System.IFormattable
public enum class RasterViewerInteractiveMode : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable Members
| Value | Member | Description |
|---|---|---|
| 0 | None | Default, no user interaction. |
| 1 | Pan | Allows the user to pan the image using the mouse. |
| 2 | CenterAt | Centers the image at the mouse coordinates for the last user click. This will call the RasterImageViewer.CenterAtPoint method. |
| 3 | ZoomTo | Zooms the image to the rectangle created by the user. |
| 4 | Region |
Creates a region based on user interaction. The type of region created depends on the RasterImageViewer.InteractiveRegionType property. |
| 5 | MagnifyGlass | Starts the MagnifyGlass. |
| 6 | Floater | Starts moving the RasterImageViewer.FloaterImage. |
| 7 | Page | Allows the user to change the current page in the image using the mouse. |
| 8 | Scale | Allows the user to change the current scale factor of the image using the mouse. |
| 9 | UserRectangle | User-defined rectangle. You should subscribe to the RasterImageViewer.InteractiveUserRectangle event to add your custom code to handle the rectangle drawn. |
| 10 | ZoomAt | Zooms the image at the mouse coordinates for the last user click. This will call the RasterImageViewer.ZoomAtPoint method with scaleFactor set to RasterImageViewer.CenterZoomAtPointScaleFactor. |
The RasterImageViewer.InteractiveMode property controls user interaction with the control's display.
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.
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 normalviewer.SizeMode = RasterPaintSizeMode.Normal;// Set interactive mode to ZoomAtviewer.InteractiveMode = RasterViewerInteractiveMode.ZoomAt;// Set the center at scale factor to 1, so zoom in twice with each clickviewer.CenterZoomAtPointScaleFactor = 2.0;viewer.InteractiveModeEnded += viewer_ZoomAtInteractiveModeEnded;}private static void viewer_ZoomAtInteractiveModeEnded(object sender, EventArgs e){// Check if this is the Center At interactive modeRasterImageViewer 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 twiceviewer.CenterZoomAtPointScaleFactor = 0.5;}else{// Back to 2, so we zoom inviewer.CenterZoomAtPointScaleFactor = 2.0;}}}
Imports Leadtools.WinFormsImports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessing.ColorImports Leadtools.DrawingPrivate Shared Sub RasterViewerInteractiveModeExample(ByVal viewer As RasterImageViewer)' Make sure the viewer size mode is normalviewer.SizeMode = RasterPaintSizeMode.Normal' Set interactive mode to ZoomAtviewer.InteractiveMode = RasterViewerInteractiveMode.ZoomAt' Set the center at scale factor to 1, so zoom in twice with each clickviewer.CenterZoomAtPointScaleFactor = 2.0AddHandler viewer.InteractiveModeEnded, AddressOf viewer_InteractiveModeEndedEnd SubPrivate Shared Sub viewer_InteractiveModeEnded(ByVal sender As Object, ByVal e As EventArgs)' Check if this is the Center At interactive modeDim viewer As RasterImageViewer = CType(sender, RasterImageViewer)If viewer.InteractiveMode = RasterViewerInteractiveMode.ZoomAt ThenIf viewer.CenterZoomAtPointScaleFactor = 2.0 Then' Switch the scale factor to 0.5, so next time we click, it will zoom out twiceviewer.CenterZoomAtPointScaleFactor = 0.5Else' Back to 2, so we zoom inviewer.CenterZoomAtPointScaleFactor = 2.0End IfEnd IfEnd Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
