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
EncoderBase encoder = null; ... //do some work to instantiate encoder as PdfEncoder or TiffEncoder and set compressionThis works for single images:
VintasoftImage img = imageViewer1.Images[i] as VintasoftImage; img.Save(fullPath, encoder);But it doesn't for collections:
imageViewer1.Images.Save(fullPath, encoder);- won't compile, method signature not recognised despite it being valid as far as Intellisense is concerned.
You have to cast it instead:
imageViewer1.Images.Save(fullPath, (PdfEncoder)encoder);Why is this the case?
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:
imageViewer1.Images.Save(fullPath, (TiffEncoder)encoder);But this code for a single image doesn't save annotations:
VintasoftImage img = imageViewer1.Images[i] as VintasoftImage; img.Save(fullPath, encoder);Thanks.
Ian
