[lazarus] PNG and resource

Darek Mazur darekm at emadar.com
Mon Nov 10 04:42:35 EST 2003


Hi
 I tested XPM before, its work fine but I have many bitmaps in BMP
 I can't find good  tools to convert BMP to XPM
and I think that use PNG will be great

Darek

----- Original Message -----
From: "Tony Maro" <tony at maro.net>
To: <lazarus at miraclec.com>
Sent: Monday, November 10, 2003 1:08 AM
Subject: Re: [lazarus] PNG and resource


> Darek Mazur wrote:
>
> >Hi
> >
> >I've try use resources like in delphi
> >I've notice that no function to load bitmap from resource (only
truecolor)
> >Than try PNG to store button image but in graphics.pp is bug or I can't
> >understand it.
> >
>
> Try something like this:
>
> Create your graphic, for instance "mypicture.xpm".  (Pixmap's work great)
>
> Then convert it to a resource at the command line:
>  > lazres mygraphicresource.lrs mypicture.xpm
>
> In your code use:
>
> MyGraphic := TPixmap.Create;
> MyGraphic.LoadFromLazarusResource('mypicture');
>
> in the Initialization section at the end of the unit be sure to add:
>
> {$I mygraphicresource.lrs} // inserts the resource into the unit
>
>
> -Tony
>
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives
>






More information about the Lazarus mailing list