VintaSoft Imaging .NET SDK 15.1: Документация для .NET разработчика
Vintasoft.Imaging.Annotation.UI Namespace / AnnotationViewController Class / BurnAnnotationCollectionOnImage Methods / BurnAnnotationCollectionOnImage(Int32) Method
Синтаксис Example Требования Смотрите также
В этом разделе
BurnAnnotationCollectionOnImage(Int32) Метод (AnnotationViewController)
В этом разделе
Записывает коллекцию аннотаций к изображению, удаляет аннотации к изображению и очищает коллекцию аннотаций к изображению.
Синтаксис
'Declaration

Public Overloads Sub BurnAnnotationCollectionOnImage( _
ByVal index
Индекс изображения в Images.
As System.Int32 _
)
public void BurnAnnotationCollectionOnImage(
System.Int32 index
)

Parameters

index
Индекс изображения в Images.
Пример

Вот пример, показывающий, как записывать аннотации на изображение:


' Create the image collection and add images to collection.
Dim imageCollection As New Vintasoft.Imaging.ImageCollection()
imageCollection.Add("D:\Images\AutoContrast.jpg")
imageCollection.Add("D:\Images\AutoColors.jpg")

' Create annotation controllers associated with image collection.
Dim annotationDataController As New Vintasoft.Imaging.Annotation.AnnotationDataController(imageCollection)
Dim annotationViewController As New Vintasoft.Imaging.Annotation.UI.AnnotationViewController(annotationDataController)

' Create a data of rectangle annotation.
Dim rectangleAnnotationData As New Vintasoft.Imaging.Annotation.RectangleAnnotationData()
rectangleAnnotationData.Location = New System.Drawing.PointF(340, 150)
rectangleAnnotationData.Size = New System.Drawing.SizeF(220, 150)
' Create a view of rectangle annotation.
Dim rectangleAnnotationView As New Vintasoft.Imaging.Annotation.UI.RectangleAnnotationView(rectangleAnnotationData)
' Add the rectangle annotation to the annotation controller.
annotationViewController(0).Add(rectangleAnnotationView)

' Burn annotation collection on the first image.
annotationViewController.BurnAnnotationCollectionOnImage(0)

' Save image collection to TIFF file.
imageCollection.SaveSync("D:\ImageCollection.tif", True)


// Create the image collection and add images to collection.
Vintasoft.Imaging.ImageCollection imageCollection = 
    new Vintasoft.Imaging.ImageCollection();
imageCollection.Add(@"D:\Images\AutoContrast.jpg");
imageCollection.Add(@"D:\Images\AutoColors.jpg");

// Create annotation controllers associated with image collection.
Vintasoft.Imaging.Annotation.AnnotationDataController annotationDataController = 
    new Vintasoft.Imaging.Annotation.AnnotationDataController(imageCollection);
Vintasoft.Imaging.Annotation.UI.AnnotationViewController annotationViewController = 
    new Vintasoft.Imaging.Annotation.UI.AnnotationViewController(annotationDataController);

// Create a data of rectangle annotation.
Vintasoft.Imaging.Annotation.RectangleAnnotationData rectangleAnnotationData = 
    new Vintasoft.Imaging.Annotation.RectangleAnnotationData();
rectangleAnnotationData.Location = new System.Drawing.PointF(340, 150);
rectangleAnnotationData.Size = new System.Drawing.SizeF(220, 150);
// Create a view of rectangle annotation.
Vintasoft.Imaging.Annotation.UI.RectangleAnnotationView rectangleAnnotationView = 
    new Vintasoft.Imaging.Annotation.UI.RectangleAnnotationView(rectangleAnnotationData);
// Add the rectangle annotation to the annotation controller.
annotationViewController[0].Add(rectangleAnnotationView);

// Burn annotation collection on the first image.
annotationViewController.BurnAnnotationCollectionOnImage(0);

// Save image collection to TIFF file.
imageCollection.SaveSync(@"D:\ImageCollection.tif", true);

Требования

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

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