ALT-TAB 应用程序图标像素化
当我的应用程序的子窗口打开并查看 ALT+TAB 菜单时,应用程序图标看起来像素化。 我假设 Windows 使用低分辨率版本的图标(我认为是 16x16 像素)。 我该怎么做才能让 Windows 选择正确的版本(32x32 像素)?
我为相关窗口分配了一个真彩色图标,尺寸为 16x16、24x24、32x32、48x38 和 256x256。 请注意,VS 在属性中表示使用了 32x32,并且它对于我分配了完全相同的图标的应用程序的主窗口工作得很好。
When a child window of my application is opened and I view the ALT+TAB menu, the application icon looks pixellated. I assume that Windows uses a low resolution version of the icon (16x16 pixel I think). What can I do that Windows selects the right version which would be 32x32 pixel?
I assigned an icon to the window in question that has 16x16, 24x24, 32x32, 48x38 and 256x256 in true color. Please note that VS says in the proterties that 32x32 is used and that it works fine for the main window of my application where I assigned the exact same icon.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Windows 应用程序窗口的标题栏以 16x16 像素显示图标。 然而,Alt-Tab 列表以 32x32 像素显示图标。 它使用与窗口设置相同的图标。 如果您只设置 32x32 的,则标题栏必须将其缩小,这往往看起来很难看,因为它使用 最近邻插值。 那么如何同时支持两者呢?
答案是 ICO 文件! 它支持在一个文件中嵌入多个图标,通常是不同尺寸的相同(或相似)图标,以及不太常见的颜色格式。
浏览器、Windows 和其他浏览器通常设计为在给定的 ICO 文件中巧妙地使用适当大小的变体。 所以答案是拥有一个内部包含两种大小(或更多)的 ICO 文件。 结果是标题栏正确使用 16x16 版本,而 Alt-Tab 使用较大的 32x32 版本。
保存包含多个图标的 ICO 文件的方法因程序而异。 然而,GIMP 可以轻松做到这一点(而且是免费的)。 诀窍是将不同大小的图标作为单独的图层。 当你将其保存为 ICO 文件时,GIMP 会提示你设置每个图层的大小和颜色格式。 可以阅读带有图像的良好教程 这里。
如果有人有任何在其他程序中创建多图标 ICO 文件的链接或建议,请随时添加。 另外,我不确定 Visual Studio 内置图像编辑器是否可以做到这一点 - 我很少为此烦恼。
The caption bar of a Windows application window display icons in 16x16 pixels. The Alt-Tab list, however, shows icons in 32x32 pixels. It uses the same icon as is set for the window. If you only set a 32x32 one, the caption bar has to scale it down, which tends to look ugly as it uses nearest-neighbor interpolation. So how does one support both?
The answer is the ICO file! It supports embedding multiple icons in one file, typically the same (or similar) icon in various sizes and, less commonly, color formats.
Browsers, Windows, and others are typically designed to smartly use the appropriately sized variant within a given ICO file. So the answer is to have an ICO file with both sizes (or more) inside. The result is that the caption bar correctly uses the 16x16 version and Alt-Tab uses the larger 32x32 one.
The methods for saving an ICO file with multiple icons inside varies from program to program. However, GIMP can easily do it (and it's free). The trick is to have your variously-sized icons as separate layers. When you go to save it as an ICO file, GIMP will prompt you with the ability to set the size and color format of each layer. A good tutorial, with images, can be read here.
If anyone has any links or suggestions for creating multi-icon ICO files in other programs, feel free to add them. Also, I'm unsure if the Visual Studio built-in image editor can do it or not — I've rarely bothered with it.
解决了这个问题。 我把图标放在了错误的表格上。 因为我认为这个问题对任何人都没有任何帮助,所以可以随意删除它。
Fixed the problem. I put the icon on the wrong form. As I don't think that this question will be of any help for anybody feel free to delete it.