如何为我的 Windows 应用程序创建高质量的图标?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2671966/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to create a high quality icon for my Windows application?
提问by Patrick Klug
If you are running Windows with a higher DPI setting you will notice that most application icons on the desktop look terrible. Even some high profile application icons such as Google Chrome look terrible while Firefox, Skype and MS Office icons look sharp:
如果您使用更高 DPI 设置运行 Windows,您会注意到桌面上的大多数应用程序图标看起来很糟糕。甚至一些高调的应用程序图标(例如 Google Chrome)看起来也很糟糕,而 Firefox、Skype 和 MS Office 图标看起来很清晰:
(example)
(例子)
I suspect that most icons look blurry because a lower resolution icon is scaled up rather than using a higher resolution icon.
我怀疑大多数图标看起来很模糊,因为较低分辨率的图标被放大而不是使用更高分辨率的图标。
I want to give my application a high quality icon and can't seem to convince Windows to use the higher resolution icon. I have created a multi-resolution icon with the icon editor IcoFX. The icon is provided in 16x16, 24x24, 32x32,48x48, 128x128 and 256x256 (!)(all in 32 bit including alpha channel) yet Windows seems to use the 48x48 version of the icon on the desktop and scale it up which looks terrible. (I am using Windows 7 - 64 bit - the icon is placed by means of setting up a shortcut in the msi (created via Visual Studio 2008 Setup Project) and pointing it to the .ico file that contains the multi-resolution icon)
我想为我的应用程序提供一个高质量的图标,但似乎无法说服 Windows 使用更高分辨率的图标。我使用图标编辑器IcoFX创建了一个多分辨率图标。该图标以16x16、24x24、32x32、48x48、128x128 和 256x256 (!)(均为 32 位,包括 alpha 通道)提供,但 Windows 似乎在桌面上使用 48x48 版本的图标并将其放大,这看起来很糟糕。(我使用的是 Windows 7 - 64 位 - 通过在 msi 中设置快捷方式(通过 Visual Studio 2008 安装项目创建)并将其指向包含多分辨率图标的 .ico 文件来放置图标)
I have tried removing the 128x128 icon but to no avail. Interestingly in Windows Explorer the icon looks great even when using the Extra Large Icon setting. How can I create a high quality desktop icon that looks great on higher DPI settings on Windows?
我曾尝试删除 128x128 图标,但无济于事。有趣的是,在 Windows 资源管理器中,即使使用超大图标设置,图标看起来也很棒。如何在 Windows 上创建在更高 DPI 设置下看起来很棒的高质量桌面图标?
EDIT: I tested removing the 128x128 option, then both the 48x48 and 128x128 option and tried Axialis IconWorkshop to create the icon - nothing worked.
编辑:我测试了删除 128x128 选项,然后删除 48x48 和 128x128 选项并尝试 Axialis IconWorkshop 创建图标 - 没有任何效果。
EDIT: After much trial and error I think the real problem here is the Visual Studio 2008 Setup Project - manually setting up a link to my executable correctly uses the high resolution icon, however the link that is created by the setup doesn't use the correct icon.When setting the icon for the link in the editor it only gives me one option (index 0) which seems to be the 48x48 icon. I have tried manually adjusting the IconIndex in the .vdproj but had no luck.
编辑:经过多次反复试验,我认为这里的真正问题是 Visual Studio 2008 安装项目 - 手动设置指向我的可执行文件的链接正确使用高分辨率图标,但是由安装程序创建的链接不使用正确的图标。在编辑器中设置链接图标时,它只给了我一个选项(索引 0),它似乎是 48x48 图标。我曾尝试手动调整 .vdproj 中的 IconIndex 但没有运气。
采纳答案by Patrick Klug
Thanks for all the suggestions!
感谢所有的建议!
After much trial and error the real problem here seems to be the Visual Studio 2008 Setup Project - manually setting up a link to my executable correctly uses the high resolution icon, however the link that is created by the setup doesn't use the correct icon. When setting the icon for the link in the editor it only gives me one option (index 0) which seems to be the 48x48 icon. I have tried manually adjusting the IconIndex in the .vdproj but had no luck. It seems that Visual Studio Setup Project does not support adding a link using a high quality icon.
经过多次反复试验,这里的真正问题似乎是 Visual Studio 2008 安装项目 - 手动设置指向我的可执行文件的链接正确使用高分辨率图标,但是由安装程序创建的链接没有使用正确的图标. 在编辑器中设置链接图标时,它只给了我一个选项(索引 0),它似乎是 48x48 图标。我曾尝试手动调整 .vdproj 中的 IconIndex 但没有运气。Visual Studio 安装项目似乎不支持使用高质量图标添加链接。
EDIT: I can now confirm this problem. Once I moved to WiX to create the installer the link used the correct high quality icon.
编辑:我现在可以确认这个问题。一旦我转移到 WiX 来创建安装程序,该链接就使用了正确的高质量图标。
回答by AC TheGypsy
easiest way is to open a copy of one of those ms .ico files in gimp, and replace those 72dpi pics with yours and scale them for each layer in the .ico file.
最简单的方法是在 gimp 中打开那些 ms .ico 文件之一的副本,然后用你的图片替换那些 72dpi 的图片,并为 .ico 文件中的每一层缩放它们。
The attached screenshot is the windows media player icon oped up in GIMP
回答by Romain Hippeau
This might give you some tips http://www.axialis.com/tutorials/tutorial-vistaicons.html
这可能会给你一些提示 http://www.axis.com/tutorials/tutorial-vistaicons.html
回答by saschabeaumont
Try enlarging your icons (Ctrl+MouseWheelUp
) to a massivesize and see if Windows picks up the larger icon, this will work even on standard DPI screen. (I use really really reallylarge icons myself).
尝试将您的图标 ( Ctrl+MouseWheelUp
)放大到更大的尺寸,看看 Windows 是否会选择更大的图标,即使在标准 DPI 屏幕上也能正常工作。(我自己使用非常非常非常大的图标)。
If using massive icons still only displays the lower resolution one, then it's a problem with the ICO file. Our graphic designer outputs icons containing 256, 64, 48, 32, 24 and 16 pixel sizes, each in True Color, 256 color and 16 color and that's working fine here on Win7 x64
如果使用大量图标仍然只显示较低分辨率的图标,则是ICO文件的问题。我们的图形设计器输出包含 256、64、48、32、24 和 16 像素大小的图标,每一个都是真彩色、256 色和 16 色,这在 Win7 x64 上运行良好
回答by Remus Rusanu
It depends on your display DPI. See the Windows User Experience Interaction Guidelines Icons sizerecommendations.
这取决于您的显示 DPI。请参阅Windows 用户体验交互指南图标大小建议。
回答by JohnnyFun
I converted my .ico to a .png and then back to an ico on this site, and it seems to have worked: http://convertico.com/
我将我的 .ico 转换为 .png,然后返回到本网站上的 ico,它似乎有效:http: //convertico.com/
Looks like it added 48x48 and 64x64.
看起来它添加了 48x48 和 64x64。
回答by Leopold Gault
I used Gimp. Export as the image as ".ico"
我用过 Gimp。将图像导出为“.ico”