ImageList>Image lazarus / 31-LCL ---------------------------------------------------------------------- AnxietyDrive · 2013-10-24 18:51 I've looked for a simple solution, but either there is non ! or I've just missed it ....... On pressing button 1 get image from Imagelist index 1 and display as property .picture of image control. On pressing button 2  .........                                      2                  etc etc To me that seems pretty straight forward and what I would have imagined the whole purpose of having an image list is for ..... clearly not?! Can anyone show how this might be implemented ? Ta ---------------------------------------------------------------------- howardpc · 2013-10-24 21:31 Here's a simple example to get you started. Drop an imagelist on an empty form in a new Lazarus project, and add five images to it. Complete the main form unit as follows: Code: [Select]unit ImageListForm; {$mode objfpc}{$H+} interface uses   SysUtils, Forms, Controls, ExtCtrls, Buttons; type   TForm1 = class(TForm)     ImageList1: TImageList;     procedure FormCreate(Sender: TObject);   private     img: TImage;     sb: TSpeedButton;     procedure ButtonClick(Sender: TObject);   end; var   Form1: TForm1; implementation {$R *.lfm} procedure TForm1.FormCreate(Sender: TObject); var   i: integer; begin   for i:=0 to 4 do begin     sb:=TSpeedButton.Create(Self);     sb.Tag:=i;     sb.ShowCaption:=True;     sb.Caption:=Format('I-%d',[i]);     sb.Top:=10;     sb.Left:=10+30*i;     sb.OnClick:=@ButtonClick;     sb.Parent:=Self;   end;   img:=TImage.Create(Self);   img.Left:=10;   img.Top:=40;   img.Parent:=Self; end; procedure TForm1.ButtonClick(Sender: TObject); begin   if not (Sender is TSpeedButton) then Exit;   ImageList1.StretchDraw(img.Canvas, TSpeedButton(Sender).Tag, img.ClientRect); end; end. ---------------------------------------------------------------------- engkin · 2013-10-24 23:42 Howardpc's example is excellent.  You might want to know that the ImageList Editor can split an image into smaller images so you can use them individually. According to the source file of ImageList Editor (Lazarus\components\ideintf\imagelisteditor.pp) there is a condition: Quote      //If the height and width of SrcBmp is an exact factor of ImageList height and width       //the image can be split into smaller images Like, for example, this forum has a picture of a set of "quick buttons" If you set a TImageList Width and Height properties to 18 and 30 and increase the height of quickbuttons.png to 240 (8*30) to fulfill the split condition then add it to that TImageList, it will provide these 8 small images individually. ---------------------------------------------------------------------- AnxietyDrive · 2013-10-25 18:10 Many thanks ..............Plenty there to work with .... Salute! AD [EDIT]: I resolved exactly what I wanted using the following method ....  Each different button passes a corresponding ImageListIndex number to the procedure; The requested image is then displayed in TImage. procedure ChangeThumb(picIndex : integer); begin   Form1.SetUpThumbs.Picture.Bitmap := nil;   Form1.SetUpThumbs.Picture.Bitmap.TransparentMode := tmFixed;   Form1.SetUpThumbs.Picture.Bitmap.TransparentColor := clWhite;   Form1.ThumbImageList.GetBitmap(1, Form1.SetUpThumbs.Picture.Bitmap); end;