I'm not sure if I have found some inconsistencies in the codebase or if it's just a misunderstanding on my part. Can you please have a look and tell me if I'm doing something wrong?
The problems I have been having are related to how the VintasoftImage and ImageViewerBase.Images[x] objects work together.
1. Saving images using BaseEncoder
Code: Select all
EncoderBase encoder = null;
... //do some work to instantiate encoder as PdfEncoder or TiffEncoder and set compression
Code: Select all
VintasoftImage img = imageViewer1.Images[i] as VintasoftImage;
img.Save(fullPath, encoder);
Code: Select all
imageViewer1.Images.Save(fullPath, encoder);
You have to cast it instead:
Code: Select all
imageViewer1.Images.Save(fullPath, (PdfEncoder)encoder);
2. Saving images with annotations
A similar thing happens when saving images with annotations. This code saves images and annotations together in a multipage TIFF:
Code: Select all
imageViewer1.Images.Save(fullPath, (TiffEncoder)encoder);
Code: Select all
VintasoftImage img = imageViewer1.Images[i] as VintasoftImage;
img.Save(fullPath, encoder);
Ian