'Where are the images in a TImageCollection held Delphi

Is it possible to access the images in TImageCollection from the executable or the resource file. i.e. outside the IDE. How are these images held?



Solution 1:[1]

Yes, image list and image collection images are stored in the DFM files. You can see this if you go to the form or data module containing the image list or collection, and then press Alt+F12 to see the DFM code. Alternatively, you can simply open the DFM file in your favourite text editor.

And these DFMs are embedded into your EXE as RCDATA resources, so you can see them if you open your EXE in a resource editor.

Solution 2:[2]

At runtime, your EXE can access the images via the TImageCollection.Images property, which is a collection of TImageCollectionItem objects.

TImageCollectionItem has a SourceImages property, which is a collection of TImageCollectionSourceItem objects.

TImageCollectionSourceItem has an Image property of type TWICImage

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andreas Rejbrand
Solution 2 Remy Lebeau