[Solved] Exe icon in all sizes?

Windows specific forum
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

[Solved] Exe icon in all sizes?

Post by BarryG »

[Solved] How do I create an icon for my exe that scales correctly whether my folder thumbs are set to Medium, Large, or Extra Large? At the higher sizes, my icon shows as 32x32 in the center of a large box in Windows Explorer, despite the icon being created at 128x128 and compiled with my exe. Thanks!
Last edited by BarryG on Thu Sep 29, 2022 10:24 am, edited 2 times in total.
User avatar
jacdelad
Addict
Addict
Posts: 1431
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

Re: Exe icon in all sizes?

Post by jacdelad »

Greenfish Icon Editor Pro may be an old program, but can do that very quickly.
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Exe icon in all sizes?

Post by BarryG »

Nope, Greenfish didn't help (thanks anyway). I was using IcoFX before as well.

Here's the source icon I tested with -> https://icons.iconarchive.com/icons/tre ... p-icon.png

And here's when I saved it as ".ico" type with both Greenfish and IcoFX and compile it with my PureBasic app:

Image

See how it doesn't scale cleanly at "Extra large icons" size in Explorer, like the "Text.xml" file does? Even PureBasic source icons don't scale.

And here's how the same compiled icon appears in my app's title bar:

Image

It looks horrible everywhere. There must be a way to do this?
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Exe icon in all sizes?

Post by Little John »

I'm not sure whether this answers your question, but a Windows standard application icon contains multiple copies of the same picture in different resolutions: 16x16, 32x32, 48x48, and 256x256.
Last edited by Little John on Sun Nov 05, 2023 2:53 pm, edited 1 time in total.
Bitblazer
Enthusiast
Enthusiast
Posts: 733
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Exe icon in all sizes?

Post by Bitblazer »

Include an icon for every size you want to support, including a 256x256 icon version with icofx.
webpage - discord chat links -> purebasic GPT4All
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: [Solved] Exe icon in all sizes?

Post by BarryG »

Yes! It finally works due to including all icon sizes; especially 256x256. Thanks, everyone!

Image
AZJIO
Addict
Addict
Posts: 1318
Joined: Sun May 14, 2017 1:48 am

Re: Exe icon in all sizes?

Post by AZJIO »

Try to make two icons in ICO file with sizes 48 and 256.
256 is a multiple of 32, 64, 128 while 48 is a multiple of 24 without trilinear interpolation.
I just came across that the author of the Scanner program changed the icons, which greatly increased the size of his tiny program and surprised the choice of icon size. Maybe it's a conscious choice that produces the desired results.

Use the free Gimp editor to edit icons. It supports the ICO format and at the same time has a full set of professional tools, unlike the free IcoFX 1.6, which I also use

I just realized that the icon export function has a flag for sizes 16 and 32. As a result, if you have an icon 32, then it is used, and if there is no icon, then it is converted from another one to the actual required size. The transformation was required, so it was done correctly, and if the transformation is not required, then the insertion was made as is in the center of the square.
Post Reply