VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging.Annotation.UI Namespace / AnnotationViewer Class / VisualTool Property
Example



In This Topic
    VisualTool Property (AnnotationViewer)
    In This Topic
    Gets or set the current VisualTool of this AnnotationViewer.
    Syntax
    'Declaration
     
    Public Overrides Property VisualTool As VisualTool
    public override VisualTool VisualTool {get; set;}
    public: __property VisualTool* get_VisualTool() override;
    public: __property void set_VisualTool( 
       VisualTool* value
    ) override;
    public:
    property VisualTool^ VisualTool {
       VisualTool^ get() override;
       void set (    VisualTool^ value) override;
    }
    Remarks
    Use the AnnotationVisualTool instance returned by this property (do not create new instance of AnnotationVisualTool class) if the viewer must use the Vintasoft.Imaging.UI.VisualTools.CompositeVisualTool as active visual tool and the Vintasoft.Imaging.UI.VisualTools.CompositeVisualTool must contain AnnotationVisualTool.
    Example
    This example shows how to create 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.
    Namespace ReferenceAPI.Vintasoft_Imaging_Annotation
    	Class AnnotationViewer_AnnotationVisualTool
                
    		' [BLOCK:CustomizeTextBox]
    		''' <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
    		' [ENDBLOCK]
                
    	End Class
    End Namespace
    namespace CSHARP.ReferenceAPI.Vintasoft_Imaging_Annotation
    {
        class AnnotationViewer_AnnotationVisualTool
        {
                
            // [BLOCK:CustomizeTextBox]
            /// <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; 
            }
            // [ENDBLOCK]
                
        }
    }
    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also