We like the ability of your components to save annotations as separate XMP files and have a business case where this would be very useful. I've got this working for single-image TIFF files using the following code:
Code: Select all
//save files
for (int i = 0; i < imageViewer1.Images.Count; i++)
{
//save each image as single file
VintasoftImage img = imageViewer1.Images[i] as VintasoftImage;
string newImageFileName = string.Format("{0}_{1}{2}", fileName, i.ToString().PadLeft(4, '0'), fileExt);
if (encoder != null)
{
img.Save(newImageFileName, encoder);
}
else
{
img.Save(newImageFileName);
}
if (saveAnnotationsToolStripMenuItem.Checked)
{
//save annotations
SaveAnnotations(i, ChangeFileExtension(newImageFileName, EXT_XMP));
}
} ...
private void SaveAnnotations(int imageIndex, string filePath)
{
if (imageViewer1.Annotations[imageIndex].Count > 0)
{
XmlDocument doc = imageViewer1.Annotations[imageIndex].Save();
doc.Save(filePath);
}
}
1. Save all images in ThumbnailViewer as a Multipage TIFF without annotations
2. Save all images in ThumbnailViewer as a Multipage TIFF with separate XMP file
3. Save selected images in ThumbnailViewer as a Multipage TIFF without annotations
4. Save selected images in ThumbnailViewer as a Multipage TIFF with separate XMP file
Is this possible? If so, can you provide me with some example code for each of these requirements?
Thanks,
Ian