7
votes

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.

2
@kyndigs Smart people can afford stupid questions ...Hamlet Hakobyan
Sorry I meant my question was stupid as it would be the first check anyone would do, I wasn't referring to your question :)kyndigs
I set it in the properties of the Project. I don't want an icon in the System Menu, so I didn't set Icon= in the Main.xaml, but it doesn't make a difference if I do.Scott Hanselman
@kyndigs Thanks for the suggestion. I was pulling out my hair trying to figure out why the Taskbar was showing the wrong icon size in my C++ program even though everything looked right in Explorer and in the ICO. Didn't realize the taskbar was using the 16x16 icon and not the ICO file.Phlucious

2 Answers

2
votes

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.

1
votes

The icon size that is displayed in your taskbar is determined by a variety of factors; 'MinWidth' value of HKEY_CURRENT_USER|Control Panel|Desktop|WindowMetrics, DPI settings, and taskbar settings.

48x48 is chosen because the default 'MinWidth' setting is (i believe) 53, and the 48x48 is the largest resolution in your icon that fits within that setting.

if you are unhappy with the way the 48x48 icon looks, it may just need re-designed. Be sure it is using the correct number of colors, etc. How do the small icons look? As bad or worse than the 48x48? if so, then perhaps the icon is too complex to look good at such a small resolution.

I know of no way to force windows to select a different icon size for the taskbar.