VisualTool Property (AnnotationViewer)
Use the AnnotationVisualTool instance returned by this property (do not create new instance of AnnotationVisualTool class) if the viewer must use the CompositeVisualTool as active visual tool and the CompositeVisualTool must contain AnnotationVisualTool.
Here is an example that shows how to create the composite visual tool, which allows to use the annotation visual tool and pan tool together, and set the tool as active tool in annotation viewer.
''' <summary>
''' Creates the composite visual tool, which allows to use the annotation visual tool and
''' pan tool together, and sets the tool as active tool in annotation viewer.
''' </summary>
''' <param name="annotationViewer">The annotation viewer.</param>
Public Sub UseAnnotationVisualToolAndPanToolInAnnotationViewer(annotationViewer As Vintasoft.Imaging.Annotation.UI.AnnotationViewer)
' create the composite visual tool
Dim tool As New Vintasoft.Imaging.UI.VisualTools.CompositeVisualTool(annotationViewer.AnnotationVisualTool, New Vintasoft.Imaging.UI.VisualTools.PanTool())
' set the composite visual tool as active tool in annotation viewer
annotationViewer.VisualTool = tool
End Sub
/// <summary>
/// Creates the composite visual tool, which allows to use the annotation visual tool and
/// pan tool together, and sets the tool as active tool in annotation viewer.
/// </summary>
/// <param name="annotationViewer">The annotation viewer.</param>
public void UseAnnotationVisualToolAndPanToolInAnnotationViewer(
Vintasoft.Imaging.Annotation.UI.AnnotationViewer annotationViewer)
{
// create the composite visual tool
Vintasoft.Imaging.UI.VisualTools.CompositeVisualTool tool =
new Vintasoft.Imaging.UI.VisualTools.CompositeVisualTool(
annotationViewer.AnnotationVisualTool,
new Vintasoft.Imaging.UI.VisualTools.PanTool());
// set the composite visual tool as active tool in annotation viewer
annotationViewer.VisualTool = tool;
}
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5