支持 Windows 7 并向后兼容的 WPF 图标规范
当我在 Windows XP 下启动 WPF 应用程序时,我遇到了 FileFormatException
的问题。正如我 弄清楚了,这是由于我的应用程序图标中的图像尺寸大于 64x64 像素引起的。
如果是 Vista 图标,则包含 png-image,用作Window.Icon的 应用程序无法启动 文件格式异常。
确保图标的最大尺寸为 64x64 像素。它仍然可以是 32 位(使用 Alpha 通道)。
这真的是图标中图像尺寸不大于 64x64 像素的唯一解决方法吗?是否有办法支持最高分辨率(256x256 像素)的 Windows 7 图标,同时向后兼容 Windows XP?
我知道不同单一 Windows 操作系统的图标规范,但是否还有如何支持 Windows 7 并向后兼容的规范?
提前致谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 png 图像设置为 Windows 图标(XAML 或代码),并在项目设置中设置具有可执行文件(项目图标)高分辨率内容的真实图标文件。 Windows XP 将接受您的窗口实例,而窗口 7 则具有高分辨率图标。
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.