VintaSoft Imaging .NET SDK 14.0: Documentation for .NET developer
In This Topic
    Viewing and transforming annotations, interaction 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:

    Programmatically access to the annotations in WinForms annotation viewer

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


    Display and interact with annotations in WinForms annotation viewer

    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


    Use different annotation interaction modes in WinForms annotation viewer

    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:


    Select one or more annotations in WinForms annotation viewer

    By default, AnnotationVisualTool class allows to select several annotations. The selected annotation collection can be get using AnnotationVisualTool.SelectedAnnotations property. The ability of multiple annotations selection can be disabled using AnnotationVisualTool.MultiSelect property. The AnnotationVisualTool.AnnotationSelectionPen property allows to specify a pen, which should be used for drawing of annotation selection.

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


    Restrict annotation building/transformation in image region in WinForms annotation viewer

    AnnotationVisualTool allows to restrict region where annotation can be built or transformed. This functionality can be enabled using AnnotationVisualTool.IsAnnotationBoundingRectEnabled property. AnnotationVisualTool.AnnotationBoundingRect property allows to set a region on image, where annotation may be built or transformed.


    Build annotation in WinForms annotation viewer

    The AnnotationVisualTool.AddAndBuildAnnotation method allows to start the annotation building process, the AnnotationVisualTool.FinishAnnotationBuilding method allows to finish the annotation building process, the AnnotationVisualTool.CancelAnnotationBuilding method allows to cancel the annotation building process.
    AnnotationVisualTool raises the AnnotationVisualTool.AnnotationBuildingStarted event when annotation building process is started, AnnotationVisualTool raises the AnnotationVisualTool.AnnotationBuildingFinished event when annotation building process is finished, AnnotationVisualTool raises the AnnotationVisualTool.AnnotationBuildingCanceled event when annotation building process is canceled.


    Transform annotation in WinForms annotation viewer

    The transformation of focused annotation may be started via mouse.
    AnnotationVisualTool raises the AnnotationVisualTool.AnnotationTransformingStarted event when annotation transformation process is started, AnnotationVisualTool raises the AnnotationVisualTool.AnnotationTransformingFinished event when annotation transformation process is finished.

    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.


    Use the annotation rotation assistant for rotating annotation in WinForms annotation viewer

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


    Expand existing functionality

    AnnotationVisualTool class has open architecture and allows to change, practically, any functionality in derived classes.