ImageEn, unit imageenio

TImageEnIO.LoadFromResource

TImageEnIO.LoadFromResource


Declaration

procedure LoadFromResource(const ModulePath: WideString; const ResourceType: String; const ResourceName: String; Format: TIOFileType);


Description

Loads the specified image resource from PE files like EXE, DLL, OCX, ICL, BPL, etc.

Parameter Description
ModulePath Specifies the path and filename of PE module
ResourceType Resource type as string, e.g. 'Bitmap', 'Cursor' or 'RCData' (Case-insensitive)
ResourceName Resource name as string, e.g. 'INTRESOURCE:100' or 'Hand' (Case-insensitive)
Format Specifies the expected file format. If Format is ioUnknown, then try to find the format automatically. ioUnknown should fail for BMP, ICO and CUR resources


Example

// Load resource 143, of type "Bitmap", from "explorer.exe" (should be a small Windows logo)
ImageEnView1.IO.LoadFromResource('explorer.exe', 'Bitmap', 'INTRESOURCE:143', ioBMP);

// Load a PNG resource in the current EXE that have been defined in a resource file as follows:
// MYLOGO RCDATA "Logo.png"
ImageEnView1.IO.LoadFromResource( Application.ExeName, 'RCDATA', 'MYLOGO', ioPNG );


See Also

 TIEResourceExtractor
 LoadFromResource