Home : DotImage : Save WANG annotation data into a TIFF file
Q10146 - HOWTO: Save WANG annotation data into a TIFF file

NOTE: This article is very out of date and greatly oversimplifies the issue. Support has marked this article for review/rewrite.. Before implementing this code please create a support case to ask support for "best practice" method for saving WANG annotation data to a TIFF file.


Use the Save method of the AnnotationController (or AnnotateViewer.Annotations) to get the annotation data.  Then save that data into the Tiff tag for Wang annotations, then you save the Tiff file.  Here is an example:

// Save the annotation data.
byte[] data = annotationViewer1.Annotations.Save(new WangFormatter());

// Add the data to a tiff tag.
TiffTagCollection tags = new TiffTagCollection();
tags.Add(new TiffTag(TiffTagID.WangAnnotations, data));

// Save the image.
TiffEncoder encoder = new TiffEncoder();
encoder.TiffTags = tags;
annotationViewer1.Save("myfile.tif", encoder);


[Visual Basic]
' Save the annotation data.
Dim data() As Byte = annotationViewer1.Annotations.Save(New WangFormatter())
' Add the data to a tiff tag.
Dim tags As TiffTagCollection =  New TiffTagCollection()
tags.Add(New TiffTag(TiffTagID.WangAnnotations, data))
' Save the image.
Dim encoder As TiffEncoder =  New TiffEncoder()
encoder.TiffTags = tags
annotationViewer1.Save("myfile.tif", encoder)

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?


Tell us why you rated the content this way. (optional)
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2020. InstantASP Ltd. All Rights Reserved