Hola Ramsay.
Creo que usamos distintas versiones de Delphi y/o biblioteca para el manejo de png, pero del modo de este ejemplo no obtengo error, fijate si te sirve de algo.
Código Delphi
[-]
...
uses PngImage;
procedure TForm1.FormCreate(Sender: TObject);
begin
ImageList1.Width := 100;
ImageList1.Height := 64;
end;
procedure ImageListAddPng(ImgLst: TImageList; const R: TRect; const PngFileName: string);
var
png : TPngObject;
bmp : TBitmap;
begin
png := TPngObject.Create();
bmp := TBitmap.Create();
try
png.LoadFromFile(PngFileName);
bmp.PixelFormat := pf32bit;
bmp.Height := png.Height;
bmp.Width := png.Width;
bmp.Assign(png);
bmp.Canvas.StretchDraw(R, bmp);
ImgLst.Add(bmp, nil);
finally
png.Free();
bmp.Free();
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ImageListAddPng(ImageList1, Rect(0, 0, 100, 64), 'facepalm.png');
SpeedButton1.Caption := '';
ImageList1.GetBitmap(0, SpeedButton1.Glyph);
end;
Salida:
Saludos