TIEBitmap.LoadFromResource
Declaration
procedure LoadFromResource(Instance: THandle; const ResName: string; ResType: PChar; FileType: TIOFileType = ioUnknown); overload;
procedure LoadFromResource(Instance: THandle; const ResID: Integer; ResType: PChar; FileType: TIOFileType = ioUnknown0); 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 |
| FileType | Specifies the file format of the image. If ioUnknown is specified, the format is detected automatically by reading the image header |
Note: You can also uses this to retrieve
ImageEn toolbar images
Examples
// 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 );
proc := TImageEnProc.CreateFromBitmap( Bitmap );
proc.HSVvar( 150, 10, 30 );
proc.Free();
See Also
◼TImageEnIO.LoadFromResource
◼TIEMultiBitmapHelper.LoadFromResource
◼TIEResourceExtractor