Sign in Join
Wiki copytemporary

How to add icons my package components

We have package "my_pkg" with components TComp1, TComp2 and want to add icons for components to IDE component pallete.

First we have to make .png 24x24 files: tcomp1.png, tcomp2.png. If you want to get them from Delphi package, you can use the free "XN Resource Editor" to export icons from .dcr files.

Now we need app "lazres". It's located in "tools" subfolder of IDE folder. Compile it under Windows: "c:\lazarus\tools\lazres.lpi" to lazres.exe. We use lazres.exe to create Lazarus resource file .lrs from .png files:

text
 c:\lazarus\tools\lazres.exe my_icons.lrs *.png

Into package my_pkg we add file my_icons.lrs (tab "Add file", type LRS). At least one unit in package must have:

text
 {$I my_icons.lrs}

Compile and install the package, two icons must appear.


From the Free Pascal wiki, page "How to add icons my package components", as it stood on 2015-07-26 after a change by Jwdietrich, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 3, last changed by WikiArchive .

Edited on wiki.freepascal.org by 2 people, 2015

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
Alextp2Created page
Alextp2
Alextp2
Alextp2
JwdietrichCategorization

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.