我的 Windows 应用程序的图标应该包含哪些图标大小?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3236115/
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
Which icon sizes should my Windows application's icon include?
提问by Daniel Rose
I have a Windows application which will run in Windows XP and newer (i.e. Vista/7). According to the Vista UI Guidelines, the standard sizes are 16x16, 32x32, 48x48, 256x256 (XP standard sizes do not include the 256x256 icon). In addition to those sizes, I also have 96x96 and 128x128 (and could create more).
我有一个可以在 Windows XP 和更新版本(即 Vista/7)中运行的 Windows 应用程序。根据Vista UI Guidelines,标准尺寸为 16x16、32x32、48x48、256x256(XP 标准尺寸不包括 256x256 图标)。除了这些尺寸,我还有 96x96 和 128x128(并且可以创建更多)。
Which of these icon sizes should I include? Will the shell actually use the "non-standard" sizes, or will I simply bloat my application?
我应该包括哪些图标大小?外壳实际上会使用“非标准”大小,还是只是让我的应用程序膨胀?
回答by Daniel Rose
I took some time to check it in detail. I created an icon whose images have sizes of 16, 24, 32, 40, 48, 64, 96, 128 and 256. Then I checked which image is shown. All these were done with normal 96dpi. If using a larger DPI, the larger sizes may be used (only checked this a bit in Windows 7). The results:
我花了一些时间仔细检查它。我创建了一个图标,其图像的大小为 16、24、32、40、48、64、96、128 和 256。然后我检查了显示的是哪个图像。所有这些都是在正常的 96dpi 下完成的。如果使用更大的 DPI,则可以使用更大的尺寸(仅在 Windows 7 中稍微检查一下)。结果:
Windows XP:
视窗 XP:
- Explorer views:
- Details / List: 16
- Icons: 32
- Tiles / Thumbnails: 48
- Right-click->Properties / choosing a new icon: 32
- Quickstart area: 16
- Desktop: 32
- 资源管理器视图:
- 详情/列表:16
- 图标:32
- 瓷砖/缩略图:48
- 右键单击->属性/选择一个新图标:32
- 快速启动区域:16
- 桌面:32
Windows 7:
Windows 7的:
- Explorer views:
- Details / List / Small symbols: 16
- All other options: 256 (resized, if necessary)
- Right-click->Properties / choosing a new icon: 32
- Pinned to taskbar: 32
- Right-click-menu: 16
- Desktop:
- Small symbols: 32
- Medium symbols: 48
- Large symbols: 256 (resized, if necessary)
- Zooming using Ctrl+Mouse wheel: 16, 32, 48, 256
- 资源管理器视图:
- 详细信息/列表/小符号:16
- 所有其他选项:256(如有必要,调整大小)
- 右键单击->属性/选择一个新图标:32
- 固定到任务栏:32
- 右键菜单:16
- 桌面:
- 小符号:32
- 中等符号:48
- 大符号:256(如有必要,调整大小)
- 使用 Ctrl+鼠标滚轮缩放:16、32、48、256
Windows Runtime: (from here)
Windows 运行时:(来自此处)
- Main tile: 150x150, 310x150 (wide version)
- Small logo: 30x30
- Badge (for lockscreen): 24x24, monochromatic
- Splashscreen: 620x300
- Store: 50x50
- 主图块:150x150、310x150(宽版)
- 小徽标:30x30
- 徽章(用于锁屏):24x24,单色
- 启动画面:620x300
- 商店:50x50
So the result: Windows XP uses 16, 32, 48-size icons, while Windows 7 (and presumably also Vista) also uses 256-size icons. All other intermediate icon sizes are ignored(they maybe used in some area which I didn't check).
结果是:Windows XP 使用 16、32、48 大小的图标,而 Windows 7(可能还有 Vista)也使用 256 大小的图标。忽略所有其他中间图标大小(它们可能用于我没有检查的某些区域)。
I also checked in Windows 7 what happens if icon sizes are missing:
我还在 Windows 7 中检查了如果缺少图标大小会发生什么:
The missing sizes are generated (obviously). With sizes of 16, 32, and 48, if one is missing, downscaling is preferred. So if we have icons with size 16 and 48, the 32 icon is created from the 48 icon. The 256 icon is only used for these if no other sizes are available!So if the icons are size 16 and 256, the other sizes are upscaled from the 16 icon!
生成缺失的尺寸(显然)。大小为 16、32 和 48,如果缺少一个,则首选缩小比例。因此,如果我们有大小为 16 和 48 的图标,则 32 图标是从 48 图标创建的。如果没有其他尺寸可用,256 图标仅用于这些!因此,如果图标大小为 16 和 256,则其他大小将从 16 图标放大!
Additionally, if the 256 icon is not there, the (possibly generated) 48 icon is used, but not resized anymore. So we have a (possibly large) empty area with the 48 icon in the middle.
此外,如果 256 图标不存在,则使用(可能生成的)48 图标,但不再调整大小。所以我们有一个(可能很大)空白区域,中间有 48 个图标。
Note that the default desktop icon size in XP was 32x32, while in Windows 7 it is 48x48. As a consequence, for Windows 7 it is relatively important to have a 48 icon.Otherwise, it is upscaled from a smaller icon, which may look quite ugly.
请注意,XP 中的默认桌面图标大小为 32x32,而在 Windows 7 中为 48x48。 因此,对于 Windows 7,拥有 48 位图标相对重要。否则,它是从一个较小的图标放大的,这可能看起来很丑陋。
Just a note about Windows XP compatibility: If you reuse the icon as window icon, then note that this can crash your application if you use a compressed 256 icon. The solution is to either not compress the icon or create a second version without the (compressed) 256 icon. See herefor more info.
关于 Windows XP 兼容性的注意事项:如果您将图标重用作窗口图标,请注意,如果您使用压缩的 256 图标,这可能会使您的应用程序崩溃。解决方案是不压缩图标或创建没有(压缩)256 图标的第二个版本。请参阅此处了解更多信息。
回答by Futal
After some testing with an icon with 8, 16, 20, 24, 32, 40, 48, 64, 96, 128 and 256 pixels (256 in PNG) in Windows 7:
在 Windows 7 中使用 8、16、20、24、32、40、48、64、96、128 和 256 像素(PNG 为 256)的图标进行了一些测试后:
- At 100% resolution: Explorer uses 16, 40, 48, and 256. Windows Photo Viewer uses 96. Paint uses 256.
- At 125% resolution: Explorer uses 20, 40, and 256. Windows Photo Viewer uses 96. Paint uses 256.
- At 150% resolution: Explorer uses 24, 48, and 256. Windows Photo Viewer uses 96. Paint uses 256.
- At 200% resolution: Explorer uses 40, 64, 96, and 256. Windows Photo Viewer uses 128. Paint uses 256.
- 在 100% 分辨率下:资源管理器使用 16、40、48 和 256。Windows 照片查看器使用 96。画图使用 256。
- 分辨率为 125% 时:资源管理器使用 20、40 和 256。Windows 照片查看器使用 96。画图使用 256。
- 在 150% 分辨率下:资源管理器使用 24、48 和 256。Windows 照片查看器使用 96。画图使用 256。
- 在 200% 分辨率下:资源管理器使用 40、64、96 和 256。Windows 照片查看器使用 128。画图使用 256。
So 8, 32 were never used (it's strange to me for 32) and 128 only by Windows Photo Viewer with a very high dpi screen, i.e. almot never used.
所以 8、32 从未使用过(32 对我来说很奇怪),而 128 仅由具有非常高 dpi 屏幕的 Windows 照片查看器使用,即 almot 从未使用过。
It means your icon should at least provide 16, 48 and 256 for Windows 7. For supporting newer screens with high resolutions, you should provide 16, 20, 24, 40, 48, 64, 96, and 256. For Windows 7, all pictures can be compressed using PNG but for backward compatibility with Windows XP, 16 to 48 should not be compressed.
这意味着您的图标应该至少为 Windows 7 提供 16、48 和 256。为了支持高分辨率的较新屏幕,您应该提供 16、20、24、40、48、64、96 和 256。对于 Windows 7,所有图片可以使用 PNG 进行压缩,但为了与 Windows XP 向后兼容,不应压缩 16 到 48。
回答by stone
The Microsoft UX icon guidelinesays:
在微软UX图标指导说:
"Application icons and Control Panel items: The full set includes 16x16, 32x32, 48x48, and 256x256 (code scales between 32 and 256)."
“应用程序图标和控制面板项目:全套包括 16x16、32x32、48x48 和 256x256(代码比例在 32 和 256 之间)。”
To me this implies (but does not explicitly state, unfortunately) that you should supply those 4 sizes.
对我来说,这意味着(但没有明确说明,不幸的是)您应该提供这 4 种尺寸。
Additional details regarding color formats, which you may also find useful:
有关颜色格式的其他详细信息,您也可能会发现它们很有用:
"Icon files require 8-bit and 4-bit palette versions as well, to support the default setting in a remote desktop."
"Only a 32-bit copy of the 256x256 pixel image should be included, and only the 256x256 pixel image should be compressed [as PNG] to keep the file size down."
“图标文件也需要 8 位和 4 位调色板版本,以支持远程桌面中的默认设置。”
“仅应包含 256x256 像素图像的 32 位副本,并且仅应压缩 256x256 像素图像 [作为 PNG] 以减小文件大小。”
回答by jaminroe
(Updated answer for Windows 8/10)
(Windows 8/10 的更新答案)
View full list of guidelines and sizes here, in new Windows design guidelines: https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-and-notifications-app-assets#asset-types
在新的 Windows 设计指南中查看指南和尺寸的完整列表:https: //msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-and-notifications-app-assets#asset -类型
Still include .ICO file with these sizes to support legacy experiences:
仍然包含具有这些大小的 .ICO 文件以支持传统体验:
- 16x16
- 24x24
- 32x32
- 48x48
- 256x256
- 16x16
- 24x24
- 32x32
- 48x48
- 256x256
回答by z4k
In the case of Windows 10 this is not exactly accurate, in fact none of the answers on stackoverflow was, I found this out when I tried to use pixel art as an icon and it got rescaled when it was not supposed to(it was easy to see in this case cause of the interpolation and smoothing windows does) even thou I used the sizes from this post.
在 Windows 10 的情况下,这并不完全准确,事实上,stackoverflow 上的所有答案都不是,当我尝试将像素艺术用作图标时我发现了这一点,并且在不应该的时候重新缩放了它(这很容易在这种情况下查看插值和平滑窗口的原因)即使我使用了这篇文章中的大小。
So I made an app and did the work on all DPI settings, see it here:
Windows 10 all icon resolutions on all DPI settings
You can also use my app to create icons, also with nearest neighbor interpolation with smoothing off, which is not done with any of the bad editors I have seen.
所以我制作了一个应用程序并完成了所有 DPI 设置的工作,请在此处查看:
Windows 10 所有 DPI 设置上的所有图标分辨率
您还可以使用我的应用程序创建图标,也可以使用最近邻插值和平滑处理,但未完成我见过的任何一个糟糕的编辑。
If you only want the resolutions:
16, 20, 24, 28, 30, 31, 32, 40, 42, 47, 48, 56, 60, 63, 84, 256
and you should use all PNG icons and anything you put in beside these it won't be displayed. See my postwhy.
如果您只需要分辨率:
16、20、24、28、30、31、32、40、42、47、48、56、60、63、84、256
,您应该使用所有 PNG 图标和您输入的任何内容除了这些,它不会被显示。看我的帖子为什么。
回答by Christian
Not 96x96, use 64x64 instead. I usually use:
不是 96x96,而是使用 64x64。我通常使用:
- 16 - status/titlebar button
- 32 - desktop icon
- 48 - folder view
- 64/128 - Additional sizes
- 16 - 状态/标题栏按钮
- 32 - 桌面图标
- 48 - 文件夹视图
- 64/128 - 其他尺寸
256 works as well on XP, however, old resource compilers sometimes complained about "out of memory" errors.
256 在 XP 上也能正常工作,但是,旧的资源编译器有时会抱怨“内存不足”错误。
回答by Jacek Krawczyk
From Microsoft MSDN recommendations:
Application icons and Control Panel items: The full set includes 16x16, 32x32, 48x48, and 256x256 (code scales between 32 and 256). The .ico file format is required. For Classic Mode, the full set is 16x16, 24x24, 32x32, 48x48 and 64x64.
应用程序图标和控制面板项目:全套包括 16x16、32x32、48x48 和 256x256(代码比例在 32 和 256 之间)。.ico 文件格式是必需的。对于经典模式,全套为 16x16、24x24、32x32、48x48 和 64x64。
So we have already standard recommended sizes of:
所以我们已经有标准的推荐尺寸:
- 16 x 16,
- 24 x 24,
- 32 x 32,
- 48 x 48,
- 64 x 64,
- 256 x 256.
- 16 x 16,
- 24 x 24,
- 32 x 32,
- 48 x 48,
- 64 x 64,
- 256 x 256。
If we would like to support high DPI settings, the complete list will include the following sizes as well:
如果我们想支持高 DPI 设置,完整列表还将包括以下尺寸:
- 20 x 20,
- 30 x 30,
- 36 x 36,
- 40 x 40,
- 60 x 60,
- 72 x 72,
- 80 x 80,
- 96 x 96,
- 128 x 128,
- 320 x 320,
- 384 x 384,
- 512 x 512.
- 20 x 20,
- 30 x 30,
- 36 x 36,
- 40 x 40,
- 60 x 60,
- 72 x 72,
- 80 x 80,
- 96 x 96,
- 128 x 128,
- 320 x 320,
- 384 x 384,
- 512 x 512。