Home > Enterprise >  How to package several icons for different sizes in a VS C app?
How to package several icons for different sizes in a VS C app?

Time:11-17

I'm developing a C app in Visual Studio 2022 with a UI (UI library is wxWidgets). I'm trying to figure out how icons work. I gathered from researching that Windows expects a variety of different icons to be packaged with apps for the best UX (see Resource View

But regardless of that, always one icon seem to be used at a time.

Checking the contents of <projectName>.rc, I see the following:

.rc excerpt

I also expect the following, in Resource.h, to be relevant:

Resource.h excerpt

It seems that independently of the icon sizes, IDI_ICON1 is used. If it's 16x16, it's upscaled in context that requires it, if it's 256x256, it's downscaled (poorly, somehow ?) when required i.e in almost all contexts.

How should this be done ? Are there resources available on the matter I may have missed ?

CodePudding user response:

You should embed all your ico files with different resolution into one ico file. The ico file is actually a container and can contain multiple images inside.

  • Related