Skip to content

Instantly share code, notes, and snippets.

@mkoertgen
Created October 29, 2015 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mkoertgen/8be8a95072a6cafc4a07 to your computer and use it in GitHub Desktop.
Save mkoertgen/8be8a95072a6cafc4a07 to your computer and use it in GitHub Desktop.
How to fix your ClickOnce icons

How to fix your ClickOnce icons

As described in ClickOnce installing dialog icon (StackOverflow) icons displayed in the ClickOnce installing dialog may seem noisy:

It should be looking like this

This is because the ClicOnce API does not seem to support alpha with the .ico file format. In fact, most legacy APIs don't support alpha well. Instead it seems to use the color value of the pixel in the lower left corner of the image.

The workaround is then to just add transparent extra column as described below.

Step1: Add transparent pixel in lower left corner using Paint.Net

  • Open .ico file in Paint.net (all layers/images)
  • Image resize 256x256 -> 255x255
  • Canvas resize 255x255 -> 256x256 (place image image bottom/right)
  • Save as new .ico-file

Step 2: Optimize Icon using IcoFx

Paint.net does seem to save .ico files always using 24 or 32 bit including alpha. For simple icons you may optimize all images to a simpler data type. You can do this in IcoFx by selecting an image and then using Image -> Data Type.

Most of the time i get along using optimized 256 colors (8 bit). I definitely recommend removing alpha unless you have good reason to keep it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment