VintaSoft Imaging .NET SDK v8.7
In This Topic
    View and transform annotations, interact with annotations in WinForms
    In This Topic

    The visual tool AnnotationVisualTool is intended for viewing, editing and interaction with the annotation collection of active image in viewer.

    AnnotationVisualTool class allows to:



    Access to annotation collection of an image

    A collection of visual appearances of annotations can be received using AnnotationViewCollection property. Visual appearance of a selected annotation can be received using AnnotationVisualTool.FocusedAnnotationView property.



    Operations with annotation collection of single image

    AnnotationVisualTool class allows to perform 3 groups of operations with annotation collection of single image:
    1. display annotation collection
    2. implement interaction between user and annotation
      • generate an event when mouse pointer is being moved above annotation
      • generate an event when the user directs mouse pointer at annotation
      • generate an event when the user clicks on an annotation
      • perform the transition on a hyperlink when the user clicks on link annotation
      • perform any other interaction between user and annotation
    3. transform a single annotation or a group of annotations
      • build and add annotation to annotation collection
      • transform annotation
        • relocate
        • resize
        • rotate
        • mirror
        • apply user defined transformation
      • remove annotation from annotation collection


    Interaction mode between user and annotations

    AnnotationVisualTool class allows to choose interaction mode between user and annotations using AnnotationVisualTool.AnnotationInteractionMode property. The following modes are available:

    Below is the diagram that illustrate events occurring in annotation engine:
    Diagram that illustrate events occurring in annotation engine

    Selection of one or more annotations

    By default, AnnotationVisualTool class allows to select several annotations. The selected annotation collection can be received using AnnotationVisualTool.SelectedAnnotations property. The ability of multiple annotations selection can be disabled using AnnotationVisualTool.MultiSelect property. Using AnnotationVisualTool.AnnotationSelectionPen property is possible to tune up a pen by which the selection is being drawn.

    Single annotation can be selected using AnnotationVisualTool.SetFocusedAnnotationView method programmatically.



    Image region where annotation may be built or transformed

    AnnotationVisualTool.IsAnnotationBoundingRectEnabled property allows to define if the region, where annotation may be built or transformed, is subject to a restriction. AnnotationVisualTool.AnnotationBoundingRect property allows to set a region on the image, where annotation may be built or transformed.



    Building of annotations

    To start the process of visual annotation building should be called AnnotationVisualTool.AddAndBuildAnnotation method, to force the finish - AnnotationVisualTool.FinishAnnotationBuilding method, and to cancel the process - AnnotationVisualTool.CancelAnnotationBuilding method.
    Before building of annotation starts is generated AnnotationVisualTool.AnnotationBuildingStarted event, when finished - AnnotationVisualTool.AnnotationBuildingFinished event, and when canceled - AnnotationVisualTool.AnnotationBuildingCanceled event.



    Transformation of annotation

    The process of annotation visual transformation may be started via mouse.
    Before transformation of annotation starts is generated AnnotationVisualTool.AnnotationTransformingStarted event, when finished - AnnotationVisualTool.AnnotationTransformingFinished event.

    The visual tool allows to transform a single annotation or a group of annotations. While transforming an annotation group is possible to perform transformation of group in whole or for each annotation separately.


    Annotation rotation assistant

    AnnotationVisualTool class contains a rotation assistant which can help when annotation needs to be rotated on a discrete angle; the rotation assistant is accessible via AnnotationVisualTool.RotationAssistant property.
    The rotation assistant works as follows:

    Rotation assistant is enabled in annotation viewer



    Expanding of existing functionality

    AnnotationVisualTool class is open for deriving and allows to change, practically, any functionality in derived classes.