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!
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.
精彩评论