Vcl.ImageCollection.TImageCollection
Delphi
TImageCollection = class(TCustomImageCollection)
C++
class PASCALIMPLEMENTATION TImageCollection : public Vcl::Baseimagecollection::TCustomImageCollection
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | Vcl.ImageCollection.pas Vcl.ImageCollection.hpp |
Vcl.ImageCollection | Vcl.ImageCollection |
Description
TImageCollection component stores, scales, and draws images.
The component allows you use images with native formats using the TWICImage class.
Use TImageCollection in combination with TVirtualImageList component as the source for images. Go to Supporting high-DPI images with the Image Collection and Virtual ImageList components for the instructions on how to use these two components.
TImageCollection is inherited from TCustomImageCollection class, which defines the base methods for a collection.
Using TImageCollection within a DLL
TImageCollection using the Windows Imaging Component (WIC), a COM-based framework. COM is always initialised by a VCL application. However, if the component is used from within a DLL and that DLL is used by your application, it will be loaded before the host application's startup code has run, ie before COM has been initialised. This results in 'Runtime error 217.'
To resolve this:
- Load the DLL explicitly using LoadLibrary and GetProcAddress.
- If the host app is not a VCL application, call CoInitialize before calling LoadLibrary.
- Mark the DLL's exported function as 'delayed', thus loading the DLL the first time the function is called, by which time the VCL app (and COM) will have been initialized
This can affect other inbuilt components that use the image collection, such as TDBNavigator.