Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF icon specifications to support Windows 7 and being backward compatible

I had the problem to get a FileFormatException as soon as I started a WPF application under Windows XP. As I figured out, it was caused by having image sizes bigger than 64x64 pixels in my application icon.

If a Vista icon, that contains png-image, is used as Window.Icon the application fails to launch with an FileFormatException.

Make sure the icon has max size 64x64 pixels. It can still be 32 bit (using alpha channel).

Is this really the only workaround to not have image sizes bigger than 64x64 pixels in my icon? Isn't there a way to support Windows 7 icons at its highest resolution (256x256 pixels) and being backward compatible to Windows XP at the same time?

I'm aware of the icon specifications for the different single Windows OSs, but is there also a specification of how to support Windows 7 and being backward compatible?

Thanks in advance!

like image 235
Martin Buberl Avatar asked Jan 22 '11 15:01

Martin Buberl


1 Answers

Set a png-image as the windows icon (XAML or code) and set in the project-settings the real icon-file with the high resolution-content for the executable file (project-icon). Windows XP will accept your Window-instances and window 7 has it's highres-icons.

like image 76
HCL Avatar answered Nov 11 '22 10:11

HCL