Delphi 2007 应用程序中的 Windows 7 兼容图标集
在 Delphi 应用程序中定义 win7 兼容图标集的正确方法是什么? (桌面上的可变大小)
我设计了一个 256*256 的图标,然后制作了 16*16、24*24、48*48 的变体。 (在 Microsoft UX 指南中,他们似乎说应该包含这些尺寸才能在桌面上正确显示)。
我已将所有图标变体放入 Gimp 的多层文档中,并将整个内容导出为 ico。然后我将其作为应用程序图标放在项目选项中,按照直接将图标分配给应用程序的方法。
最后,我在Win桌面(win7)上放置了一个快捷方式,但是当在桌面(Win 7)上使用“Ctrl+Wheel”(调整桌面图标大小,如果您还不知道......)时,正确的图标是不显示,48*48后保持相同大小(我怀疑只使用48*48版本)。
What is the right way to define a win7-compatible icon set in a Delphi application ? ( variable size on desktop )
I have designed a 256*256 icon then made the 16*16, 24*24, 48*48 variants. ( in Microsoft UX guide, they seem to say that these sizes should be included for a correct display on the desktop).
I've put all icons variations in a multiple layer document in Gimp and exported the whole stuff as an ico. Then I've put it as the application icon in the project options, following the straight way to assign an icon to an application.
FInally I've put a shorcut on Win desktop (win7) but when making "Ctrl+Wheel" (resizing of desktop icons, if you don't know it yet...) on the desktop (Win 7), correct icon is not displayed, after 48*48 it keeps the same size ( I suspect that only the 48*48 version is used).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
256px 大小的图标应该是压缩的 PNG 图标。我怀疑 Delphi 2007 附带的资源编译器不喜欢这种格式,因此您需要使用 MS 资源编译器 rc。该图标应命名为
MAINICON
。也就是说,我怀疑 256px 位图会起作用,它会非常大。更重要的是,IIRC,Delphi IDE 不喜欢 256px PNG 图标,因此通过 IDE 将图标添加到项目中是没有用的。您需要自己构建 .res 文件并将其与
{$R ...}
指令链接。最后,您的 .ico 文件可能不正确。 256px 图像实际上以宽度和高度等于 0 的方式存储,因为该字段是字节大小的,并且 0 以前是无效的。也许这就是 IDE 的笑柄。在不同的工具中检查 .ico 文件,例如 IcoFX。
可能还有其他问题——这些只是我这些年来遇到过的问题。如果我不得不猜测哪个问题困扰着您,我会说这是 IDE 无法处理 256px 图标。
我相信在最近的版本中,IDE 在这方面已经变得越来越好,但即使在我目前使用的 D2010 中,它也并不完美。
The 256px sized icon should be a compressed PNG icon. I suspect that the resource compiler shipped with Delphi 2007 won't like that format so you'll need to use the MS resource compiler, rc. The icon should be named
MAINICON
. That said, I suspect that a 256px bitmap will work, it will just be exceedingly large.What's more, IIRC, the Delphi IDE doesn't like 256px PNG icons so it's no good adding the icon to the project through the IDE. You need to build the .res file yourself and link it with a
{$R ...}
directive.Finally, its possible that your .ico file may not be correct. The 256px image is actually stored with width and height equal to 0 because that field is byte sized and 0 was formerly invalid. Perhaps this is what the IDE gags on. Check the .ico file out in a different tool, e.g. IcoFX.
There may be other problems—these are just the ones I can recall encountering over the years. If I had to guess as to which issue was biting you, I'd say it was the inability of the IDE to handle 256px icons.
I believe that the IDE has got progressively better in this area in more recent versions, but even in D2010 which I currently use, it's not perfect.