delphiimagelisttimagelist

see the content of an TImagelist in runtime


is possible invoke in runtime the TImagelist editor to see the contents of my TImagelist?


Solution

  • That editor is a design-time editor and is not available at runtime, but you can draw any of the images saved inside an ImageList on any canvas by calling its Draw method and specifying index of the image which you want to draw. The sample code below draws all images saved inside ImageList1 on Form1 in a vertical list:

    var
      i : Integer;
    begin
      for i := 0 to ImageList1.Count-1 do
        ImageList1.Draw(Form1.Canvas, 16, 16 + (i * ImageList1.Height),i,True);
    end;