[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'ImgList' (#lcl)

TCustomImageList.AddLazarusResource

Gets a bitmap from a Lazarus resource and stores it in the image list.

Declaration

Source position: imglist.pp line 351

public function TCustomImageList.AddLazarusResource(

  const ResourceName: string;

  MaskColor: TColor = clNone

):Integer;

Arguments

ResourceName

  

The name of the Lazarus resource.

MaskColor

  

The mask color for transparent images. clNone for solid (opaque) images.

Function result

Position where the image was stored.

Description

AddLazarusResource is an Integer function used to load and store a bitmap from a Lazarus resource.

ResourceName contains the Lazarus resource loaded in the method.

MaskColor is a TColor value used as the transparency color in masked images. The default value for the parameter is clNone, and indicates that the image should be rendered as an opaque (solid) image.

AddLazarusResource calls the CreateBitmapFromLazarusResource routine to get the TCustomBitmap for the specified ResourceName. When MaskColor contains a value other that clNone, it is set as the transparent color in the bitmap and transparency is enable for the image.

AddLazarusResource calls the Add method to store the bitmap in the image list. The return value contains the ordinal position in the image list where the bitmap was stored.

See also

TCustomImageList.Add

  

Adds an image to the list using its source data and optional mask.

CreateBitmapFromLazarusResource

  

Creates and loads a Bitmap from a Lazarus Resource (.lrs) file.


Version 3.2 Generated 2024-02-25 Home