function IconStringToIcon
function IconStringToIcon(Icon,Target : String; Bmp : TBitmap32) : boolean;
function IconStringToIcon(Icon,Target : String; Bmp : TBitmap32; Size : integer) : boolean;
Declared in: svn\Common\Units\SharpIconUtils\SharpIconUtils.pas
Parameters
- Icon: String
SharpE Icon String.
This string can either be 'shell:icon' , a SharpE Icon Tag like 'file.config' or the file path to a .png or .ico file.
- Target: String
If the icon parameter is 'shell:icon' then this parameter specifies the target for which the shell icon is going to be loaded.
This parameter is not used if the icon parameter is different from 'shell:icon'
- Bmp: TBitmap32
Pointer to an already created TBitmap32 class where the icon will be painted in.
- Size: integer (optional)
When loading .ico files it could be important to specify the base size of the icon which should be loaded from the file (.ico files can contain several icons of different size).
If you need to extract bigger icons then make sure to adjust this parameter.
If the param is not set then the system default value for the icon size is used.
Description
By using the Iconstringtoicon function it's possible to draw a SharpE Icon String into a target Bitmap.
The return value of the functions will be true if loading and drawing the icon into the bitmap was successfull.
Examples
IconStringToIcon('shell:icon','C:\',MyBitmap); IconStringToIcon('sharpe.icon.tag','',MyBitmap,64); IconStringToIcon('C:\1.png','',MyBitmap);
