VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging.Annotation.UI Namespace / AnnotationViewer Class / AddAndBuildAnnotation Methods / AddAndBuildAnnotation(AnnotationData) Method
Syntax Exceptions Example Requirements SeeAlso
In This Topic
    AddAndBuildAnnotation(AnnotationData) Method (AnnotationViewer)
    In This Topic
    Adds annotation to the annotation collection of focused image and starts building of annotation.
    Syntax

    Parameters

    annotationData
    Annotation to build.

    Return Value

    Annotation view.
    Exceptions
    ExceptionDescription
    Thrown if annotation can not be built in current AnnotationInteractionMode mode.
    Example

    Here is an example that shows how to add an ellipse annotation to the annotation collection of focused image and start building of annotation.

    
    Private Sub buildEllipseAnnotationButton_Click(sender As Object, e As System.EventArgs)
        ' create the ellipse annotation data
        Dim ellipseAnnotationData As New Vintasoft.Imaging.Annotation.EllipseAnnotationData()
        ' create the ellipse annotation view
        Dim ellipseAnnotationView As Vintasoft.Imaging.Annotation.UI.EllipseAnnotationView = DirectCast(Vintasoft.Imaging.Annotation.UI.AnnotationViewFactory.CreateView(ellipseAnnotationData), Vintasoft.Imaging.Annotation.UI.EllipseAnnotationView)
    
        ' add annotation to the annotation collection of focused image and
        ' start building of annotation
        annotationViewer1.AddAndBuildAnnotation(ellipseAnnotationView)
    End Sub
    
    
    
    private void buildEllipseAnnotationButton_Click(object sender, System.EventArgs e)
    {
        // create the ellipse annotation data
        Vintasoft.Imaging.Annotation.EllipseAnnotationData ellipseAnnotationData = 
            new Vintasoft.Imaging.Annotation.EllipseAnnotationData();
        // create the ellipse annotation view
        Vintasoft.Imaging.Annotation.UI.EllipseAnnotationView ellipseAnnotationView = 
            (Vintasoft.Imaging.Annotation.UI.EllipseAnnotationView)Vintasoft.Imaging.Annotation.UI.AnnotationViewFactory.CreateView(ellipseAnnotationData);
    
        // add annotation to the annotation collection of focused image and
        // start building of annotation
        annotationViewer1.AddAndBuildAnnotation(ellipseAnnotationView);
    }
    
    

    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