Back to Devexpress

TcxCustomImageList.LoadImage(THandle,string,TColor,Integer,TLoadResources) Method

vcl-cximagelist-dot-tcxcustomimagelist-dot-loadimage-x28-system-dot-thandle-system-dot-string-vcl-dot-graphics-dot-tcolor-system-dot-integer-vcl-dot-imglist-dot-tloadresources-x29.md

latest5.2 KB
Original Source

TcxCustomImageList.LoadImage(THandle,string,TColor,Integer,TLoadResources) Method

Loads a specific image from the specified resource module.

Declaration

delphi
function LoadImage(AInstance: THandle; const AResourceName: string; AMaskColor: TColor = clDefault; AWidth: Integer = 0; AFlags: TLoadResources = []): Boolean;

Parameters

NameTypeDescription
AInstanceTHandle

A handle to the resource module.

| | AResourceName | string |

A resource name.

| | AMaskColor | TColor |

The transparency mask color.

| | AWidth | Integer |

The width of new images, in pixels.

| | AFlags | TLoadResources |

Stores image load settings.

|

Returns

TypeDescription
Boolean

True if the function successfully loads and appends one or more images to the image list; otherwise, False.

|

Remarks

Unlike the GetInstRes function, LoadImage can load only a bitmap resource whose name within the package is passed as the AResourceName parameter. The LoadImage function treats the image’s upper-left pixel color as the mask color. You can use the AMaskColor optional parameter to specify the color used to generate a transparency mask bitmap for the loaded image.

Note

The image’s transparency mask bitmap is ignored if the Masked property is set to False.

You can use the optional ALoadFlags parameter to pass additional image load settings. Refer to the TLoadResource type description for detailed information on available options.

This function divides the loaded image into multiple images or truncates it to match the list’s dimensions as the Add function does. The LoadImage function uses the Width property value as the default width of appended images.

Note

The LoadImage , GetInstRes, and ResInstLoad functions are designed to load images from packaged resources. To load an image from an individual resource file, call the ResourceLoad or FileLoad function instead.

See Also

TcxCustomImageList.AddBitmap

TcxCustomImageList.AddIcon

TcxCustomImageList.AddImage

TcxCustomImageList.AddImages

TcxCustomImageList.AddMasked

TcxCustomImageList.Clear

TcxCustomImageList.CopyImages

TcxCustomImageList.Delete

TcxCustomImageList.Insert

TcxCustomImageList.InsertIcon

TcxCustomImageList.InsertMasked

TcxCustomImageList.Replace

TcxCustomImageList.ReplaceIcon

TcxCustomImageList.ReplaceMasked

TcxCustomImageList Class

TcxCustomImageList Members

cxImageList Unit