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

Howard Page-Clark hdpc at talktalk.net
Wed Aug 31 16:45:42 CEST 2011


On 31/8/11 3:34, Zaher Dirkey wrote:
>>     Is it possible in the future to have this feature
>>
>>     Add an png file to the package, when compile the package it
>>     automatically convert it to the .lrs file related to this package,
>>     it is useful for adding image icons for our controls.
>
>     When you create a new component for a package you can select an icon
>     (not only png).
>
>     Creating an lrs from a png is a one liner on the console/terminal.
>
> Thanks for your replay, but it is more easy for newbe Lazarus users or
> for lazy people like me.

I presume you are aware that selecting an icon for a new component in 
the Package Editor causes automatic generation of an appropriate .lrs 
file for the icon, provided the icon has the same name as the new 
component class (ignoring extension), and that it is no bigger than 
24x24 pixels? Lazarus also auto-generates in the Register procedure an 
appropriate {$I componentUnitName_icon.lrs} line as well. So provided 
you are only adding one new component, everything is done for you by the 
IDE, except for designing the icon.
If you want several icons to be registered in one unit for several 
components, then you do have to write a bit of code, and use the 
lazres.exe tool to generate the correct .lrs file yourself.

Howard





More information about the Lazarus mailing list