VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging.Annotation.UI Namespace / AnnotationViewer Class / AnnotationVisualTool Property
Syntax Remarks Example Requirements SeeAlso
In This Topic
    AnnotationVisualTool Property (AnnotationViewer)
    In This Topic
    Gets or sets the AnnotationVisualTool that is used for interaction with annotations.
    Syntax
    Remarks

    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.

    Visual tool, returned by this property, will be used by viewer only when you set this tool as current tool of viewer using the VisualTool property.

    Example

    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; 
    }
    
    

    Requirements

    Target Platforms: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also