[Lazarus] [Feature request] Add PNF image to Package

Paul Ishenin ip at kmiac.ru
Thu Sep 1 02:10:53 CEST 2011


31.08.2011 22:34, Zaher Dirkey wrote:
> BTW, why i cant add it to the source directly e.g.{$r afile.png}, like
> as i do it with {$r afile.lfm}, it is related to FreePascal.

You can place an image into a BITMAP resource and add it to the package 
using {$R mybitmap.res}. Image must be in .bmp format.

But if you want to add a png resource there are few problems:
1. Windows does not have a png resource type.
2. FPC does not know how to interprete {$R afile.png}
3. TPortableNetworkGraphics class has no method to load from a windows 
resource.

You can try to solve those problems starting from the first.

Best regards,
Paul Ishenin.





More information about the Lazarus mailing list