RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomImageList.GetInstRes Method (THandle, TResType, DWORD, Integer, TLoadResources, TColor)

Loads a specified bitmap, cursor, or icon resource into the image list.

Pascal
function GetInstRes(Instance: THandle; ResType: TResType; const Name: string; Width: Integer; LoadFlags: TLoadResources; MaskColor: TColor): Boolean; overload;
function GetInstRes(Instance: THandle; ResType: TResType; ResID: DWORD; Width: Integer; LoadFlags: TLoadResources; MaskColor: TColor): Boolean; overload;
C++
__fastcall Boolean GetInstRes(THandle Instance, TResType ResType, const AnsiString Name, int Width, TLoadResources LoadFlags, TColor MaskColor);
__fastcall Boolean GetInstRes(THandle Instance, TResType ResType, DWORD ResID, int Width, TLoadResources LoadFlags, TColor MaskColor);

Use the GetInstRes method to load bitmap, cursor, or icon resource into an image list.  

Instance is the instance handle of the resource module.  

ResType indicates the type of resource (rtBitmap, rtCursor or rtIcon). 

Name or ResID identifies the resource by name or ID, respectively.  

Width specifies the width, in pixels, of the image. 

LoadFlags specifies how to load the image. 

MaskColor sets the transparent color for the image.

Note: GetInstRes must be used to load a resource from within a package. Within a package, GetResource or FileLoad returns an error.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!