使用“加载图标”时可以使用 VISTA 大小的图标吗?在德尔福7中?
在 Delphi 7 的应用程序选项卡中使用“加载图标”时,我无法加载包含 Vista 大小的图标的图标
。有人知道如何使用在 Delphi 7 中开发的应用程序在 Vista 和 Windows 7 中显示大于 48x48 的图标吗?
I cannot load icons which contain Vista sized icons when using the 'Load icon' in the application tab of Delphi 7.
Does someone knows how to display icons bigger than 48x48 in Vista and Windows 7 using an application developed in Delphi 7?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
图标是图像的集合。从 Windows Vista 开始,引入了对 PNG 压缩图像的支持,事实上,当您说“Vista 图标”时,图形设计器会将其视为包含 PNG 图像(以及其他尺寸)的图标。
解决方案(1):删除 256x256 PNG 图像,128x128 alpha 通道图像已经足够了,它们可以与 Delphi 7 一起使用。并且不要对此感到太糟糕,Visual Studio 有(有???)很多问题带有 PNG 压缩图像本身!
解决方案(2):使用 Delphi-7 兼容的图标进行构建,在 Delphi 为您提供 Exe 后,使用某种工具将图标替换为您想要的图标(ResourceHacker 是免费的,对我来说工作得很好,它可以从命令行,这样我就可以在我的自动化构建中使用它)
A icon is a collection of images. Starting with Windows Vista support for PNG compressed images has been introduced, and in fact when you say "Vista icon" the graphics designer takes it as a icon containing the PNG image (among other sizes).
Solution (1): Remove the 256x256 PNG image, the 128x128 alpha-channel images are quite enough and they do work with Delphi 7. And don't feel too bad about it, Visual Studio had (has???) lots of problems with PNG compressed images itself!
Solution (2): Use a Delphi-7 compatible icon for the build and after Delphi gives you the Exe replace the icon with the one you want, using some tool (ResourceHacker is free and works fine for me, it can be controlled from the command-line so I can use it in my automated builds)
在 Delphi 7 exe 中添加高分辨率图标非常简单:
http://thesunrinkle.blogspot.com /2010/10/如何添加高分辨率图标-to.html
It is VERY EASY to add high resolution icons in your Delphi 7 exe:
http://thesunstroke.blogspot.com/2010/10/how-to-add-high-resolution-icons-to.html
我刚刚发现我遇到的问题 - 以及我首先提出这个问题的原因 - 是由于我的 .ico 文件中的 256 x 256 图像是 PNG 压缩格式。
我正在使用 Iconworks 编辑我的图标文件。右键单击 256 x 256 图像并取消选中“PNG 图像压缩格式 (Windows VISTA)”选项,然后再次保存 ico 文件,解决了我的问题。 Delphi 7 现在可以很好地读取、合并和使用图标文件。
但它确实使图标文件变得更大。
我希望这对其他人有帮助。
I just found out that the problems I was having - and the reason why I asked the question in the first place - was due to the fact that the 256 x 256 image in my .ico file was a PNG compressed format.
I am using Iconworks to edit my icon files. Right clicking the 256 x 256 image and unchecking the 'PNG image compressed format (Windows VISTA)' option, and saving the ico file again, solved my problem. Delphi 7 reads, merges and used the icon file just fine now.
It does make the icon file much larger though.
I hope this helps others.