Hola Jose Roman.
No conozco el componente que mencionas, pero si desciende de
TCustomImageList como comentas, tendría que funcionarte de este modo:
Código Delphi
[-]
uses PNGImage;
procedure ExportPngImages(CusImgLst: TCustomImageList; Path: string);
var
BMP: TBitmap;
PNG: TPNGObject;
i: Integer;
begin
Path:= IncludeTrailingPathDelimiter(Path);
for i:= 0 to CusImgLst.Count - 1 do
begin
BMP:= TBitmap.Create;
PNG:= TPNGObject.Create;
try
CusImgLst.GetBitmap(i, BMP);
PNG.Assign(BMP);
PNG.SaveToFile(Format('%sPNGImage%d.PNG', [Path, i+1]));
finally
BMP.Free;
PNG.Free;
end;
end;
end;
Ejemplo de uso:
Código Delphi
[-]
procedure TForm1.Button1Click(Sender: TObject);
begin
ExportPngImages(ImageList1, 'C:\tmp\iconos');
end;
En este caso realicé las pruebas con un componente
TImageList (otro descendiente de
TCustomImageList) y funciona correctamente.
Saludos