2
votes

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

3
it is possible, but efforts of hacking into package with imagelist component editor are incomparable than of implementing own editor.Free Consulting

3 Answers

6
votes

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;
5
votes

You can drop a ListView on some form and do something like this:

var
  i: Integer;
  li: TListItem;
begin
  ListView1.LargeImages := ImageList1;
  ListView1.Items.BeginUpdate;
  try
    for i := 0 to Pred(ImageList1.Count) do
    begin
      li := ListView1.Items.Add;
      li.Caption := Format('Image %d', [i]);
      li.ImageIndex := i;
    end;
  finally
    ListView1.Items.EndUpdate;
  end;
end;
0
votes

CodeSite has a pretty code logger. You can use it to dump bitmap objects, and see it in the logger window.

http://www.raize.com/DevTools/CodeSite/Default.asp