Wrong sized icon showing up in Windows taskbar for WPF app

c#, icons, windows, windows-8, wpf

Solution

Taskbar icons seem to get blurry as soon as a 48x48 pixels version is included in the .ico file. Instead of picking the correctly sized 32x32 pixels version, for some reason Windows apparently picks the 48x48 one and scales it up.

The solution for me is to use two separate icon files:

- One .ico containing 24x24 and 32x32 versions of the icon, which will, when set as a Window's icon using the `Icon` property in XAML or Hannish's approach, be used for the titlebar and taskbar respectively - without unwanted scaling.

- A second icon file containing - depending on which sources are right - a range of sizes between 16x16 and 256x256 pixels. Setting this one as the application icon in the project properties will make the icon look good in all the other places like the desktop and the file explorer on different view settings.

Testing on Windows 10, this seems to cover the following display cases: taskbar, window titlebar, Alt-TAB menu, Desktop and file explorer.

Problem

I have a simple WPF app. I have a nice multi-res icon with sizes all the way from 256x256 down to 16x16. All the usual stuff. My app looks awesome in Windows Explorer, the icon looks awesome, even at Extra Large view. The icons scale nicely and I see the appropriate icon for the appropriate resolution. However, the 48x48 is always used for the pinned taskbar or pinned start menu and it looks awful. I can't find anything about this in the usual locations, but my gut says that someone must know something and I'm just missing something obvious.

Original source