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

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

    WpfAnnotationVisualTool class allows to:



    Access to annotation collection of an image

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



    Operations with annotation collection of single image

    WpfAnnotationVisualTool 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

    WpfAnnotationVisualTool class allows to choose interaction mode between user and annotations using WpfAnnotationVisualTool.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, WpfAnnotationVisualTool class allows to select several annotations. The selected annotation collection can be received using WpfAnnotationVisualTool.SelectedAnnotations property. The ability of multiple annotations selection can be disabled using WpfAnnotationVisualTool.MultiSelect property. Using WpfAnnotationVisualTool.AnnotationSelectionPen property is possible to tune up a pen by which the selection is being drawn.

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



    Image region where annotation may be built or transformed

    WpfAnnotationVisualTool.IsAnnotationBoundingRectEnabled property allows to define if the region, where annotation may be built or transformed, is subject to a restriction. WpfAnnotationVisualTool.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 WpfAnnotationVisualTool.AddAndBuildAnnotation method, to force the finish - WpfAnnotationVisualTool.FinishAnnotationBuilding method, and to cancel the process - WpfAnnotationVisualTool.CancelAnnotationBuilding method.
    Before building of annotation starts is generated WpfAnnotationVisualTool.AnnotationBuildingStarted event, when finished - WpfAnnotationVisualTool.AnnotationBuildingFinished event, and when canceled - WpfAnnotationVisualTool.AnnotationBuildingCanceled event.



    Transformation of annotation

    The process of annotation visual transformation may be started via mouse.
    Before transformation of annotation starts is generated WpfAnnotationVisualTool.AnnotationTransformingStarted event, when finished - WpfAnnotationVisualTool.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

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

    Rotation assistant is enabled in annotation viewer



    Expanding of existing functionality

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