The wrong size icon appears in the Windows taskbar for the WPF application.

I have a simple WPF application. I have a nice multi-mode icon ranging in size from 256x256 to 16x16. All the usual thing.

My application looks amazing in Windows Explorer, the icon looks amazing even in Extra Large mode. The icons are clearly visible, and I see the corresponding icon for the corresponding resolution.

However, 48x48 is always used for a docked taskbar or attributed start menu, and it looks awful.

I can't find anything about this in ordinary places, but my gut says that someone needs to know something, and I'm just missing something obvious.

+6
source share
2 answers

The icons in the taskbar appear blurry as soon as a 48x48 pixel version is added to the .ico file. Instead of choosing the correct 32x32 pixel version, for some reason, Windows seems to select 48x48 and scale it.

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

  • One .ico containing 24x24 and 32x32 icon versions, which will be set as a window icon using the Icon property in the XAML or Hannish approach, will be used for the title and taskbar, respectively - without undesired scaling.
  • A second icon file containing - depending on which sources are correct - a size range from 16x16 to 256x256 pixels. Setting this as the application icon in the project properties will make the icon look good in all other places, such as the desktop and file explorer, in different viewing settings.

Testing in Windows 10 seems to cover the following storefronts: taskbar, window title, Alt-TAB menu, desktop, and file explorer.

+2
source

The size of the icon displayed on the taskbar is determined by many factors; MinWidth for HKEY_CURRENT_USER | Control panel | Desktop | WindowMetrics, DPI settings and taskbar settings.

48x48 is selected because the default "MinWidth" parameter (I think) is 53, and 48x48 is the largest resolution in your icon that matches this setting.

If you are unsatisfied with what the 48x48 icon looks like, reconfiguration may be required. Make sure it uses the correct number of colors, etc. What do the small icons look like? How bad or worse than 48x48? if so, then the icon may be too complex to look good at such a low resolution.

I don’t know how to make windows choose a different icon size for the taskbar.

+1
source

Source: https://habr.com/ru/post/969623/


All Articles