VintaSoft Annotation .NET Plug-in Discussions

Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.

Board index < VintaSoft Imaging < VintaSoft Annotation .NET Plug-in Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Possible inconsistencies in codebase?



Possible inconsistencies in codebase?

Post by iansml »

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
EncoderBase encoder = null;
... //do some work to instantiate encoder as PdfEncoder or TiffEncoder and set compression
This 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


Re: Possible inconsistencies in codebase?

Post by Alex »

Hi Ian,

ImageCollection is a collection of images so it can be saved only to multipage image file, i.e.TIFF or PDF file. Image collection cannot be saved to single PNG or BMP file because these formats does not support storing of multiple images in file.

Best regards, Alexander


Re: Possible inconsistencies in codebase?

Post by iansml »

OK, thanks for the clarification about the difference between ImageCollection and the VintasoftImage. However, I'm not sure why this would cause the inconsistencies I have detailed above.

1. Why do you have to cast the BaseEncoder when saving the ImageCollection but you don't have to cast the BaseEncoder when you save the VintaSoft image, despite them having the same method signatures?
2. Why is it that when you save a multipage Tiff via the ImageCollection, the annotations are ALWAYS saved, but when you save the VintasoftImage they are not - you have to save them separately?

Also, is there any way you can save an annotated multipage Tiff as separate XMP and TIF files?

Thanks for all your help Alex!

Ian


Re: Possible inconsistencies in codebase?

Post by Alex »

Hi Ian,
Why do you have to cast the BaseEncoder when saving the ImageCollection but you don't have to cast the BaseEncoder when you save the VintaSoft image, despite them having the same method signatures? I'm not sure that I have understood the question, please explain.
Why is it that when you save a multipage Tiff via the ImageCollection, the annotations are ALWAYS saved, but when you save the VintasoftImage they are not - you have to save them separately? ImageCollection can be linked with AnnotationController and this allows to use images with annotations. Separate VintasoftImage object cannot be linked with annotations.
Also, is there any way you can save an annotated multipage Tiff as separate XMP and TIF files? You can save annotation collection as XMP file using the Save method of the AnnotationCollection class.

You should save each VintasoftImage object from ImageCollection separately if you want to save images without annotations.

Best regards, Alexander


Page 1 from 1: 1