This project is read-only.

How to make icons invariant to DPI resolution?

Jan 18, 2011 at 11:39 AM
Edited Jan 19, 2011 at 7:02 AM


I have a problem with icons at buttons in fluent ribbon. I created icon file with 16,20,24,32,40,48,60,64px vraiants of the icons. When I change resolution from 96 to 120 dpi in my Windows 7 there is used 32x32 version stretched to 40x40 instead of using 40x40 version in the ico file. I am using VS2010. Is there any solution how to make ribbon to take the appropriate size of the icon?

The second possibility is not to allow WPF to stretch the icons from 32px to 40px when 120 dpi set. I realized that for example Office 2010 do not stretch the icons but only the text. Is there any possibility how to say WPF to keep the original size of the icons?

Thank you for any suggestions.