VintaSoft Imaging .NET SDK 15.1: Документация для .NET разработчика
Vintasoft.Imaging.Annotation.UI Namespace / AnnotationViewer Class / AddAndBuildAnnotation Methods / AddAndBuildAnnotation(AnnotationView) Method
Синтаксис Exceptions Example Требования Смотрите также
В этом разделе
AddAndBuildAnnotation(AnnotationView) Метод (AnnotationViewer)
В этом разделе
Добавляет аннотацию в коллекцию аннотаций сфокусированного изображения и начинает создание аннотации.
Синтаксис
'Declaration

Public Overloads Sub AddAndBuildAnnotation( _
ByVal annotationView
Аннотация для построения.
As AnnotationView _
)
public void AddAndBuildAnnotation(
AnnotationView annotationView
)

Parameters

annotationView
Аннотация для построения.
Исключения
ИсключениеОписание
Выбрасывается, если аннотация не может быть построена в текущем режиме AnnotationInteractionMode.
Пример

Вот пример, показывающий, как добавить аннотацию в виде эллипса в коллекцию аннотаций сфокусированного изображения и начать построение аннотации.


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);
}

Требования

Целевые платформы: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

Смотрите также