Each class can only read 1 format.

btnAdd.Glyph is a TBitmap and therefore reads only bitmaps. But you
can first read to a PNG and then use Assign to convert to a bitmap.

Try doing it like this:

var
  MyPNG: TPortableNetworkGraphic;
begin
  MyPNG := TPortableNetworkGraphic;
  MyPNG.LoadFromLazarusResource('edit_add');
  btnAdd.Glyph.Assign(MyPNG);
  MyPNG.Free;

-- 
Felipe Monteiro de Carvalho

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to