LEADTOOLS Support
Document
Document SDK Examples
HOW TO: Convert LEADTOOLS' AnnObjects to/from TIFF Tag Wang Annotations
#1
Posted
:
Monday, September 10, 2018 12:51:52 PM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 199
Was thanked: 28 time(s) in 28 post(s)
The LEADTOOLS v20 SDK supports both importing from and exporting to TIFF tag Wang annotations. For further information about this support, refer to the following page:
https://www.leadtools.com/sdk/annotationTIFF Tag Wang Annotations to LEADTOOLS' AnnObjects: (loading from TIFF tags)Loading is extremely straight forward, and can be done using the
AnnCodecs.LoadAll method. Below is all you'll need:
Code:
static AnnContainer[] WangTagToLEAD(string tifFile)
{
AnnCodecs annCodecs = new AnnCodecs();
return annCodecs.LoadAll(tifFile);
}
LEADTOOLS' AnnObjects to TIFF Tag Wang Annotations: (saving to TIFF tags)Saving is a two step process. You must first generate the tag, a
RasterTagMetadata object, using the
AnnCodecs.SaveToTag method. Next, for write each tag to a file using the
RasterCodecs.WriteTag method:
Code:
static void LEADToWangTag(IEnumerable<AnnContainer> containers, string tifFile)
{
AnnCodecs annCodecs = new AnnCodecs();
int page = 1;
using (RasterCodecs rasterCodecs = new RasterCodecs())
foreach (AnnContainer container in containers)
{
RasterTagMetadata tag = annCodecs.SaveToTag(container, page, true);
rasterCodecs.WriteTag(tifFile, page, tag);
page++;
}
}
Anthony Northrup
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
Document
Document SDK Examples
HOW TO: Convert LEADTOOLS' AnnObjects to/from TIFF Tag Wang Annotations
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.