Visual tool for zooming image region in image viewer.
Rectangular region of image in image viewer can be zoomed as follows:
- place the mouse to the desired position
- press the action button (ActionButton) and select the "zoom" region by holding the action button
- release the action button
- press the action button (ActionButton) inside the "zoom" region for zooming of image; press any mouse button outside of the "zoom" region for canceling zooming of image
If
ActionButton is set to right mouse button, context menu during action can be disabled with the
DisableContextMenu property.
This C#/VB.NET code shows how to programmatically zoom an image in image viewer.
Class ZoomSelectionToolExample
' Programmatically zoom an image in image viewer.
Public Sub ProgrammaticallyZoomImageInViewer(viewer As Vintasoft.Imaging.UI.ImageViewer)
' create an instance of ZoomSelectionTool class
Dim zoomSelectionTool As New Vintasoft.Imaging.UI.VisualTools.ZoomSelectionTool()
' set the tool as the current tool of the ImageViewer
viewer.VisualTool = zoomSelectionTool
' set the region of interest on image
zoomSelectionTool.Rectangle = New System.Drawing.Rectangle(50, 50, 250, 150)
' zoom the selected region of image
zoomSelectionTool.Zoom()
End Sub
End Class
class ZoomSelectionToolExample
{
// Programmatically zoom an image in image viewer.
public void ProgrammaticallyZoomImageInViewer(
Vintasoft.Imaging.UI.ImageViewer viewer)
{
// create an instance of ZoomSelectionTool class
Vintasoft.Imaging.UI.VisualTools.ZoomSelectionTool zoomSelectionTool =
new Vintasoft.Imaging.UI.VisualTools.ZoomSelectionTool();
// set the tool as the current tool of the ImageViewer
viewer.VisualTool = zoomSelectionTool;
// set the region of interest on image
zoomSelectionTool.Rectangle = new System.Drawing.Rectangle(50, 50, 250, 150);
// zoom the selected region of image
zoomSelectionTool.Zoom();
}
}
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5