[Lazarus] lazarus resources

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Tue Feb 7 15:32:42 CET 2012


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




More information about the Lazarus mailing list