Picking the right resolution for RibbonWindow’s Icon


It has been reported that when using an icon file as RibbonWindow.Icon, the icon is rendered blurry due to bitmap scaling. The reason for this issue is the inherent behavior of WPF Image element to simply display the first decoded bitmap frame within an icon file instead of picking the best match in terms of resolution. This behavior isn’t really manifested unless you use the RibbonWindow. This is because when using a RibbonWindow WPF Image element is rendering the Application icon whereas for a regular WPF Window it is the OS that renders the icon and picks the right resolution. Attached is a workaround app that demonstrates how to manually decode the icon file and pick an image of the right resolution to be rendered as the Application Icon.

Please notice that the Application icon shows a red tint (which is the 16×16 icon), whereas the icon in the taskbar shows the yellow tint (which is the 32×32 icon).





Leave a comment