RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomImageList.GetBitmap Method

Retrieves a specified image as a bitmap.

Pascal
function GetBitmap(Index: Integer; Image: TBitmap): Boolean;
C++
__fastcall Boolean GetBitmap(int Index, TBitmap Image);

Use the GetBitmap method to obtain a particular image in the image list as a bitmap object. Index denotes the index of the image. GetBitmap assigns the image to the TBitmap object passed in as the Image parameter.  

Delphi Examples: 

 

{
This example assigns a bitmap contained in an ImageList to
an Image component's Picture's Bitmap property and displays
the bitmap.  TImage Stretch will fit the bitmap to the image
size.
}
procedure TForm1.Button1Click(Sender: TObject);
begin
   ImageList1.GetBitmap(2,Image1.Picture.Bitmap);
   Image1.Stretch := True;
end;

 

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