窗口中的图标属性导致 Windows XP SP2 中的应用程序崩溃

发布于 2024-08-20 18:50:42 字数 589 浏览 2 评论 0原文

假设我有这个:

如果我在 Windows 7 上运行该程序,那就没问题。如果我在 Windows XP SP2 上运行它,它就会崩溃。删除 Icon 属性后,它在 Windows XP 上工作正常,但在 Windows 7 任务栏或 Window 上没有我的 myicon。

另外,在 VS 项目菜单上设置应用程序图标不适用于 W7,但适用于 XP。总结:

= XP 损坏,W7 还可以
没有 = 好的 XP,丑陋的 W7
VS 项目图标选项 = 不适用于 W7,好的 XP

作为记录,我创建了 16x16、22x22 等图标,直到 32、24 和 8 位的 256x256。我还使用了 IconFX 自动选项来为 Windows XP 创建 .ico 映像。

有办法解决这个问题吗?或者我必须在丑陋的 Windows 7(和 Vista?)应用程序还是没有 Windows XP 应用程序之间做出选择?

Suppose I have this:

<Window stuff Icon="Resources\myicon.ico">

If I run the program on Windows 7, it's fine. If I run it on Windows XP SP2, it crashes. Removing the Icon property, it works fine on Windows XP, but then it doesn't have my myicon on the Windows 7 taskbar or on the Window.

Also, setting the application icon on the VS project menu doesn't work for W7, but works for XP. In summary:

<Icon> = broken XP, ok W7
No <Icon> = ok XP, ugly W7
VS project icon option = doesn't work for W7, ok XP

For the record, I created icons for 16x16, 22x22, etc up till 256x256 for 32, 24 and 8 bits. I also used IcoFX auto option of creating the .ico image for Windows XP.

Is there a way around this? Or do I have to choose between an ugly Windows 7(and Vista?) App or no Windows XP app?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

溇涏 2024-08-27 18:50:42

XP 不支持 256x256 图标。删除 XP 的 256 图标。

XP does not support 256x256 icons. Remove the 256 icon for XP.

红衣飘飘貌似仙 2024-08-27 18:50:42

它与分辨率无关,而与格式有关:Windows XP 无法处理 ICO 文件中的 PNG 压缩图标。通常只有较大的分辨率才会被压缩,大部分是 256x256。
我使用 http://iconverticons.com/ 创建 ICO 文件,它们还使用 PNG 压缩 128x128 图像。

要解决此问题,请在 Visual Studio 中打开 ICO 文件并删除 PNG 格式图标的所有版本。或者,您可以使用 icoFx 将 PNG 图标转换为 BMP 格式。只需在选项对话框中禁用压缩并将图标保存到新文件中即可。
您可以在这里下载 IcoFx 最新的免费版本:http://www.chip。 de/downloads/IcoFX-letzte-Freeware-Version_28266149.html

It has nothing to do with the resolution, but with the format: Windows XP can't handle PNG compressed icons in an ICO file. Normally only the bigger reolutions are compressed, mostly 256x256.
I used http://iconverticons.com/ to create ICO files and they also compress the 128x128 images using PNG.

To solve this, open your ICO file in Visual Studio and delete all versions of the icon in PNG format. Alternatively you can convert the PNG icons to BMP format with icoFx. Just disable compression in the options dialog and save your icon to a new file.
You can download IcoFx latest free version here: http://www.chip.de/downloads/IcoFX-letzte-Freeware-Version_28266149.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文