private static void AnnotateTiffUsingTemporaryFile()
{
// create image collection
Vintasoft.Imaging.ImageCollection images = new Vintasoft.Imaging.ImageCollection();
// create annotation controller associated with image collection
Vintasoft.Imaging.Annotation.AnnotationDataController annotations =
new Vintasoft.Imaging.Annotation.AnnotationDataController(images);
// load TIFF file into collection
images.Add("sourceTiffFile.tif");
// get annotation collection for selected image
Vintasoft.Imaging.Annotation.AnnotationDataCollection imageAnnotations = annotations[images.Count - 1];
// create new annotation
Vintasoft.Imaging.Annotation.RectangleAnnotationData anno =
new Vintasoft.Imaging.Annotation.RectangleAnnotationData();
anno.Size = new System.Drawing.SizeF(300, 300);
anno.FillBrush = new Vintasoft.Imaging.Annotation.AnnotationSolidBrush(System.Drawing.Color.AliceBlue);
anno.Location = new System.Drawing.PointF(0, 0);
// add new annotation into annotation collection
imageAnnotations.Add(anno);
Vintasoft.Imaging.Codecs.Encoders.TiffEncoder encoder =
new Vintasoft.Imaging.Codecs.Encoders.TiffEncoder();
// specify that annotations must be saved with image collection
encoder.AnnotationsFormat = Vintasoft.Imaging.AnnotationsFormat.VintasoftBinary;
// save image collection synchronously to new file
images.SaveSync("destTiffFile.tif", encoder);
}
Forum 'Code samples'
Code samples for VintaSoft Annotation .NET Plug-in. Here you can request a code sample.
Board index < VintaSoft Imaging < VintaSoft Annotation .NET Plug-in Discussions < Code samples
