Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to get multiple icon file into Delphi resource file

I’m trying to generate a multi-size icon file to my Delphi app, so Windows will choose the best size to show in each situation.

Following the official support instructions at https://docwiki.embarcadero.com/RADStudio/Sydney/en/Creating_and_Deploying_App_Icons

Storing Your Icon Files into an Icon Container
Once you have your app
icon in all the resolutions that a target platform requires, for
desktop platforms you must then archive the different resolutions of
your icon into a single file, an icon container, that you can deploy
along with your application.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

For Windows, you must create an .ico icon container file. See How to
make/get a multi size .ico file?."

It directs to this Stack Overflow question :

How to make/get a multi size .ico file?

I followed the instructions exactly as described and could get a multi-size icon file using ImageMagick.

Problem is , when i try to compile my resource file using BRCC32, i get this error :

[BRCC32 Error] icon.rc(2): Allocate failed

Here is the contents of my RC file :

LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
MAINICON icon "myapp.ico"

If i go to Project > Application > Icons, i can load the myapp.ico without problems, but due to the nature of my project, i need to use a resource file instead.

Please help, i’m stuck on this issue for days.

Thanks

>Solution :

From the documentation on resource compilers:

Both C++Builder and Delphi give you a choice of resource compilers. On the Project > Options > Resource Compiler dialog box, you can select either of the following:

  • BRCC32.exe, the C++Builder resource compiler
  • RC.exe, the Microsoft platform SDK Resource Compiler

RC supports Unicode characters in resource files and file names, as well as new Vista resource types such as icons with alpha channel.

Hence, if you need Vista icons, you need to change to the RC compiler.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading