Skip to content

Editing .ICO files for Win32 applications in Visual Studio

Jan Krassnigg edited this page Aug 6, 2022 · 1 revision

Visual Studio wants an .ico file for the application icon.

The ICO editor in Visual Studio is unable to edit (paint) images that use 32 bit, though! All editing functionality (including pasting) is just disabled, making this pretty much impossible.

However, since a magic color is used for "transparency" you really only need 24 bit anyway.

Edit your image in Paint.net or so. Rescale it to all the needed dimensions (64x64, 48x48, 32x32, 16x16) and fill the transparent part with some obvious color (pink or so).

Note that ICOs (at least the Visual Studio ones) use a greenish color to represent transparency and therefore no smooth transparent borders are possible. That means you need hard edges. That in turn means, if you scale an image down, you probably need to use nearest neighbor sampling. It's going to be ugly either way.

Now create each image type in VS in your .ico file (right click -> New Image Type...). Paste each image. Then bucket fill the pink areas with the 'transparency color' from the color swatch.

Save it and don't think too much about it.

Clone this wiki locally