The Image Reuse topic of the DynamicPDF help advises that it is best to use the same ImageData object when using the same image multiple times within a document.
I plan to maintain a collection of ImageData objects and add to the collection each time an image is desired. My problem is how can I tell if an existing ImageData object within the collection already exists for the image I want to use? That is, when I pass in a bitmap (from the embedded resources in my project) how does my class know if it has already created an ImageData object for this bitmap?
I don't see any distinguishing properties in the ImageData class (like the Name property for the FontFamily class) that I can grab onto as I iterate over my list of existing ImageData objects to determine if I need to create a new ImageData object or I can reuse an existing ImageData object.
Distinction of ImageData Objects
Re: Distinction of ImageData Objects
Support · Mar 21, 2008Hello,
Using our product it is not possible to maintain the ImageData object collection. However you can achieve your requirement by using a HashTable or other collections from .NET which takes a Key and value pair. You can have the image name or some unique value of the image you are adding as the key and you can check this key if it exists in the collection. If the key is not present in the collection then you will have to create a new object otherwise you can use the existing object.
Thanks,
ceTe Software Support Team.