我的 Windows 应用程序的图标应包含哪些图标尺寸?

发布于 2024-09-10 03:50:33 字数 336 浏览 3 评论 0 原文

我有一个 Windows 应用程序,可以在 Windows XP 和更高版本(即 Vista/7)中运行。根据 Vista UI 指南,标准尺寸为 16x16, 32x32、48x48、256x256(XP 标准尺寸不包括 256x256 图标)。除了这些尺寸之外,我还有 96x96 和 128x128(并且可以创建更多尺寸)。

我应该包含以下哪些图标尺寸? shell 是否会实际使用“非标准”尺寸,或者只是让我的应用程序变得臃肿?

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).

Which of these icon sizes should I include? Will the shell actually use the "non-standard" sizes, or will I simply bloat my application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

嘴硬脾气大 2024-09-17 03:50:33

我花了一些时间详细检查了一下。我创建了一个图标,其图像尺寸为 16、24、32、40、48、64、96、128 和 256。然后我检查了显示的图像。所有这些都是在正常的 96dpi 下完成的。如果使用较大的 DPI,则可以使用较大的尺寸(仅在 Windows 7 中对此进行了检查)。结果:

Windows XP:

  • 资源管理器视图:
    • 详细信息/列表:16
    • 图标:32
    • 图块/缩略图:48
  • 右键单击​​ -> 属性/选择新图标: 32
  • 快速启动区域: 16
  • 桌面: 32

Windows 7:

  • 资源管理器视图:
    • 详细信息/列表/小符号:16
    • 所有其他选项:256(如有必要,可调整大小)
  • 右键单击 -> 属性/选择新图标:32
  • 固定到任务栏:32
    • 右键菜单:16
  • 桌面:
    • 小符号:32
    • 中号符号:48
    • 大符号:256(如有必要,可调整大小)
    • 使用 Ctrl+鼠标滚轮缩放:16、32、48、256

Windows 运行时:(从这里

  • 主图块:150x150、310x150(宽版)
  • 小徽标:30x30
  • 徽章(用于锁屏):24x24,单色
  • 启动屏幕:620x300
  • 存储:50x50

所以结果:Windows XP 使用 16、32 ,48 大小的图标,而 Windows 7(可能还有 Vista)也使用 256 大小的图标。 所有其他中间图标大小都将被忽略(它们可能在我没有检查的某些区域中使用)。


我还在 Windows 7 中检查了如果图标尺寸丢失会发生什么:

丢失的尺寸被生成(显然)。对于 16、32 和 48 的尺寸,如果缺少一个,则首选缩小尺寸。因此,如果我们有大小为 16 和 48 的图标,则 32 图标是从 48 图标创建的。 256 图标仅用于没有其他尺寸可用的情况!因此,如果图标尺寸为 16 和 256,则其他尺寸将从 16 图标放大!

此外,如果 256 图标不存在,则使用(可能生成的)48 图标,但不再调整大小。所以我们有一个(可能很大)空白区域,中间有 48 图标。

请注意,XP 中的默认桌面图标大小为 32x32,而 Windows 7 中的默认桌面图标大小为 48x48。
因此,对于 Windows 7 来说,拥有 48 的图标相对重要。否则,它是由较小的图标放大的,看起来可能相当难看。


关于 Windows XP 兼容性的注意事项:如果您将该图标重新用作窗口图标,请注意,如果您使用压缩的 256 图标,这可能会使您的应用程序崩溃。解决方案是不压缩图标或创建没有(压缩的)256 图标的第二个版本。有关详细信息,请参阅此处

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:

Windows XP:

  • Explorer views:
    • Details / List: 16
    • Icons: 32
    • Tiles / Thumbnails: 48
  • Right-click->Properties / choosing a new icon: 32
  • Quickstart area: 16
  • Desktop: 32

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

Windows Runtime: (from here)

  • Main tile: 150x150, 310x150 (wide version)
  • Small logo: 30x30
  • Badge (for lockscreen): 24x24, monochromatic
  • Splashscreen: 620x300
  • Store: 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 may be used in some area which I didn't check).


I also checked in Windows 7 what happens if icon sizes are missing:

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!

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.

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.


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 here for more info.

迷迭香的记忆 2024-09-17 03:50:33

在 Windows 7 中使用 8、16、20、24、32、40、48、64、96、128 和 256 像素(PNG 中为 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。

所以从未使用过 8、32(这对我来说很奇怪对于 32) 和 128,只能通过具有非常高 dpi 屏幕的 Windows 照片查看器,即几乎从未使用过。

这意味着您的图标至少应为 Windows 7 提供 16、48 和 256。为了支持高分辨率的较新屏幕,您应提供 16、20、24、40、48、64、96 和 256。对于 Windows 7,所有图片可以使用 PNG 进行压缩,但为了向后兼容 Windows XP,不应压缩 16 到 48 的图片。

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:

  • 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.

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.

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.

染火枫林 2024-09-17 03:50:33

Microsoft UX 图标指南指出:

“应用程序图标和控制面板项目:全套包括 16x16、32x32、48x48 和 256x256(代码比例在 32 到 256 之间)。”

对我来说,这意味着(但不幸的是,没有明确说明)您应该提供这 4 种尺寸。

有关颜色格式的其他详细信息,您可能也会发现它们很有用:

  • “图标文件还需要 8 位和 4 位调色板版本,以支持远程桌面中的默认设置。”

  • “仅应包含 256x256 像素图像的 32 位副本,并且仅应将 256x256 像素图像压缩 [为 PNG] 以减小文件大小。”

The Microsoft UX icon guideline says:

"Application icons and Control Panel items: The full set includes 16x16, 32x32, 48x48, and 256x256 (code scales between 32 and 256)."

To me this implies (but does not explicitly state, unfortunately) that you should supply those 4 sizes.

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."

巴黎夜雨 2024-09-17 03:50:33

在 Windows 10 的情况下,这并不完全准确,事实上 stackoverflow 上的答案都不是,当我尝试使用像素艺术作为图标时我发现了这一点,并且它在不应该的时候被重新缩放(这很容易)在这种情况下查看插值和平滑窗口的原因)即使我使用了这篇文章中的尺寸。

所以我制作了一个应用程序并完成了所有 DPI 设置的工作,请在此处查看:
Windows 10 所有图标所有 DPI 设置的分辨率
您还可以使用我的应用程序来创建图标,也可以使用最近邻插值和平滑处理,这是我见过的任何糟糕的编辑器都没有完成的。

如果您只想要分辨率:
16、20、24、28、30、31、32、40、42、47、48、56、60、63、84、256
并且您应该使用所有 PNG 图标,并且您在这些图标旁边放置的任何内容都不会显示。请参阅我的帖子< /a> 为什么。

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.

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.

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 post why.

2024-09-17 03:50:33

(针对 Windows 8/10 的更新答案)

在新的 Windows 设计指南中查看指南和尺寸的完整列表:https://msdn.microsoft.com/en-us/windows/uwp/controls- and-patterns/tiles-and-notifications-app-assets#asset-types

仍包含以下尺寸的 .ICO 文件以支持旧版体验:

  • 16x16
  • 24x24
  • 32x32
  • 48x48
  • 256x256

(Updated answer for 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

Still include .ICO file with these sizes to support legacy experiences:

  • 16x16
  • 24x24
  • 32x32
  • 48x48
  • 256x256
夜巴黎 2024-09-17 03:50:33

不是 96x96,请使用 64x64。我通常使用:

  • 16 - 状态/标题栏按钮
  • 32 - 桌面图标
  • 48 - 文件夹视图
  • 64/128 - 附加大小

256 在 XP 上也可以使用,但是,旧的资源编译器有时会抱怨“内存不足”错误。

Not 96x96, use 64x64 instead. I usually use:

  • 16 - status/titlebar button
  • 32 - desktop icon
  • 48 - folder view
  • 64/128 - Additional sizes

256 works as well on XP, however, old resource compilers sometimes complained about "out of memory" errors.

夏の忆 2024-09-17 03:50:33

微软官方指南说:

应用至少应具有:16x16、24x24、32x32、48x48 和 256x256。

以下是一些程序的列表以及它们在 ICO 文件中包含的大小:

应用程序 图标 16 20 24 32 40 48 60 64 72 80 96 256
Google Chrome 106
IntelliJ IDEA 2022.2.3
MS PowerToys 0.63.0
MS Paint 11.2208.6.0
MS 任务管理器 10.0
MS Word 2021 ✓ ✓ <
a href="https:// Visualstudio.microsoft.com/" rel="nofollow noreferrer">MS Visual Studio 2022

我们可以使用 ImageMagick 像这样:

./magick my-source-image.png -background transparent -define icon:auto-resize="16,24,32,48,64,256" C:/Users/Hello/Desktop/result.ico

注释

  1. 没有应用程序包含 128 尺寸
  2. 256 尺寸为 PNG 格式;其他是 ICO
  3. MSMicrosoft 的缩写。
  4. 图标是从带有 .exe 文件中提取的"https://www.nirsoft.net/utils/iconsext.html" rel="nofollow noreferrer">此工具
  5. 您可以保存上述图标并使用 ImageMagick 自行检查它们,如下所示:
    ./magick 识别“C:/Users/Hello/Desktop/result.ico”
    

This official Microsoft guide says:

Apps should have, at the bare minimum: 16x16, 24x24, 32x32, 48x48, and 256x256.

Here is a list of some programs and the sizes they have included in their ICO file:

Application Icon 16 20 24 32 40 48 60 64 72 80 96 256
Google Chrome 106
IntelliJ IDEA 2022.2.3
MS PowerToys 0.63.0
MS Paint 11.2208.6.0
MS Task Manager 10.0
MS Word 2021
MS Visual Studio 2022

We can create an ICO file with various sizes from a PNG etc. with ImageMagick like this:

./magick my-source-image.png -background transparent -define icon:auto-resize="16,24,32,48,64,256" C:/Users/Hello/Desktop/result.ico

Notes

  1. No app has included the 128 size
  2. The 256 size is PNG format; others are ICO
  3. MS is short for Microsoft
  4. The icons were extracted from program .exe files with this tool
  5. You can save the above icons and inspect them for yourself with ImageMagick like so:
    ./magick identify "C:/Users/Hello/Desktop/result.ico"
    
如梦初醒的夏天 2024-09-17 03:50:33

来自 Microsoft MSDN 建议

应用程序图标和控制面板项目:全套包括 16x16、32x32、48x48 和 256x256(代码比例在 32 到 256 之间)。需要 .ico 文件格式。对于经典模式,全套尺寸为 16x16、24x24、32x32、48x48 和 64x64。

因此,我们已经有标准推荐尺寸:

  • 16 x 16、24
  • x 24、32
  • x 32、48
  • x 48、64
  • x 64、256
  • x 256。

如果我们想支持高 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.

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.

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.

If we would like to support high DPI settings, the complete list will include the following sizes as well:

  • 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.
一百个冬季 2024-09-17 03:50:33

TL;博士。在 Visual Studio 2019 中,当您将 Icon 资源添加到 Win32(桌面)应用程序时,您会获得一个自动生成的图标文件,其中包含格式如下。我认为排名第一的 Windows 开发人员工具可以正确地做到这一点。因此,Windows 兼容版应具有以下格式:

| Resolution | Color depth | Format |
|:-----------|------------:|:------:|
| 256x256    |      32-bit |  PNG   |
| 64x64      |      32-bit |  BMP   |
| 48x48      |      32-bit |  BMP   |
| 32x32      |      32-bit |  BMP   |
| 16x16      |      32-bit |  BMP   |
| 48x48      |       8-bit |  BMP   |
| 32x32      |       8-bit |  BMP   |
| 16x16      |       8-bit |  BMP   |

TL;DR. In Visual Studio 2019, when you add an Icon resource to a Win32 (desktop) application you get an auto-generated icon file that has the formats below. I assume that the #1 developer tool for Windows does this right. Thus, a Windows compatible should have the following formats:

| Resolution | Color depth | Format |
|:-----------|------------:|:------:|
| 256x256    |      32-bit |  PNG   |
| 64x64      |      32-bit |  BMP   |
| 48x48      |      32-bit |  BMP   |
| 32x32      |      32-bit |  BMP   |
| 16x16      |      32-bit |  BMP   |
| 48x48      |       8-bit |  BMP   |
| 32x32      |       8-bit |  BMP   |
| 16x16      |       8-bit |  BMP   |
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文