unit ImageListGetBitmap;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ImgList;

type
  TForm1 = class(TForm)
    ImageList1: TImageList;
    Image1: TImage;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: ImageListGetBitmap
// Method: ImgList.TCustomImageList.GetBitmap
// Property: ExtCtrls.TImage.Stretch
// BeginCode
{
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;
// EndCode
// EndExample: ImageListGetBitmap
end.
