TIEBitmap.LoadFromResource
Declaration
procedure LoadFromResource(Instance: THandle; const ResName: string; ResType: PChar; Format: integer = 0); overload;
procedure LoadFromResource(Instance: THandle; const ResID: Integer; ResType: PChar; Format: integer = 0); overload;
Description
Load an image from a resource.
Parameter | Description |
Instance | The instance handle associated with the executable or shared library that contains the resource (e.g. HInstance for the current application) |
ResName/ResID | The name or ID associated with resource |
ResType | The type of the resource as defined when it was created, e.g. RT_BITMAP for a bitmap resource, or RT_RCDATA for raw data |
Format | If this is 0 then the image format will be detected by reading its content, otherwise specify a type such as ioJPEG |
Note: You can also uses this to retrieve
ImageEn toolbar images// Load the About Box image from a JPEG resource in the current application
MainForm1.ImageEnView1.IEBitmap.LoadFromResource( HInstance, 'AboutImage', RT_RCDATA, ioJPEG );
// Load the About Box image from a bitmap resource in the current application
MainForm1.ImageEnView1.IEBitmap.LoadFromResource( HInstance, 'AboutImage', RT_BITMAP, ioBMP );
// Get a toolbar button image from the ImageEn resources
Bitmap.LoadFromResource( HInstance, ITBRES_PROMPTTOSAVE_24 , RT_RCDATA, ioPNG );
if not isEnabled then
Bitmap.ConvertToGray();
// Get a bright red image
Bitmap.LoadFromResource( HInstance, ITBRES_COLOR_PALETTE_24, RT_RCDATA, ioPNG );
with TImageEnProc.CreateFromBitmap( Bitmap ) do
begin
HSVvar( 150, 10, 30 );
Free;
end;
See Also
◼LoadFromResource◼LoadFromResource◼TIEResourceExtractor