In Delphi 7, an image editor program is included, which can read and write .dcr
files, which are merely binary resource files (.res
files) with a
I have investigated the previous responses using Delphi XE5 upd2. Not much success. So I tried to build a new solution and found one derived from previous answers.
In short: 1. Create your bitmap using Windows Paint program. 2. Create a resource script file with the bitmap. 3. Compile the script with BRCC32 to produce the dcr file 4. Include the dcr file into the package source 5. Recompile/Install the package
To automate this, it is enough to add the BRCC32 command line into the package project "pre-build events". This way, you dcr file will be recreated before each build.
For a detailed description, see my blog at http://francois-piette.blogspot.be/2014/02/howto-create-dcr-file-for-your-delphi.html
Try Resource Editor. A nice replacement for old Image Editor.
I have used and had great success with:
I just tried the following, in XE, and was successful.
The source file for dclusr.pdk got a new entry {$R *.dres}
(note the extension). I could see the TNewAnimate in the Samples palette with the glyph in TMRUComboBox.bmp.
I located dclusr.dres in the same directory as dclusr.dpk (which is normally under C:\Program Files, but not in my setup). I tried to open it with XN Resource Editor, but that refused to open it with a cryptic error message. It is not a normal .res file, it seems.
First add 'mypackageicons.rc' file to the project, this produces 'mypackageicons.res' at compile time (see related SO answer to the question "Including resource file in a project by .RC file rather than .RES file").
Also include {$R mypackageicons.res mypackageicons.dcr}
to the component unit (or to the .dpk). This does not produce a '.dcr file', but sets the icon for the component.
Note that my test with a 'BMP' resource failed. I used 'BITMAP' as resource type.