Possible inconsistencies in codebase?
Posted: Mon Apr 27, 2009 2:31 pm
Hi Alex,
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
This works for single images:
But it doesn't for collections:
- won't compile, method signature not recognised despite it being valid as far as Intellisense is concerned.
You have to cast it instead:
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:
But this code for a single image doesn't save annotations:
Thanks.
Ian
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