Sizes of frame icons used in Swing

不问归期 提交于 2019-11-26 10:34:21

Typical views for this Windows 7 based PC

Note: @bobbel reports the same sizes are used for Windows 10.

Frame - 20x20

Task Bar - 40x40 in task bar itself, hover app shows 20x20

Windows+Tab - 20x20

Alt+Tab - 40x40 in lower right, shrunken 20x20 in upper left.

Task Manager - 20x20

mKorbel

@mKorbel Huh.. did not realize there would be a difference there. Well, user/OS preferences rules over programmer expectation! ;)

  • answer is only about Win8(ent, 64b ....)/WinXP(not mentioned, but setting are quite similair)

  • there are another options please see Bug or feature: Swing default gui font incorrect for Win6+ by @kleopatra, etc

  • is possible to set 64x64 icon on desktop in win8

  • e.g. my setting (not advanced graphics personalizations, despite the fact that I'm Win2008/12 admin, blablabla- "leaving surealism with reversed color scheme, now only with Black & Orange Colors" -end blablabla)

  • generating

  • standard setting (only unmarked Use small taskbar buttons)

  • your window on my screen

It seems there are no Frame or Dock icons when run in Mac OS X 10.9 (Mavericks):

Also, no icon in Activity Monitor:

Ubuntu 12.04 LTS

The taskbar icon size can be changed between 32 and 64, but all the time uses the 32x32 icon. I have also recompiled the program, but keeps using the same icon.

Taskbar and window (there is not icon at windows).

Alt + Tab

no icon at task manager

I've found out an interesting thing on Win10 (could be also true for Win7 and Win8, but I haven't tried it yet).

By default, Win10 will use image sizes of 20x20 (small) and 40x40 (big).

So, what if you let start your image sizes at 22? It will use image sizes 30x30 (small) and 40x40 (big)!

Generating a whole table of it shows interesting behaviors (tests between tested start sizes result in previous sizes; so 4 will also result in 20x20 and 40x40):

If you start at 2, it will use 20x20 and 40x40.
If you start at 22, it will use 30x30 and 40x40.
If you start at 32, it will use for both 40x40.
If you start at 42, it will use for both 60x60.
If you start at 62, it will use 78x78 and 80x80.
If you start at 80, it will use for both 80x80.
If you start at 82, it will use 98x98 and 120x120.
If you start at 100, it will use 100x100 and 120x120.
If you start at 102, it will use 118x118 and 120x120.
If you start at 120, it will use for both 120x120.
If you start at 122, it will use 138x138 and 158x158.
... okay this is enough ...

I don't really get the pattern behind, but i found it very interesting...

In the end it's really up to you, which sizes you provide. Every OS has it's own logic to show up specific icons. Either it will be scaled up or down if you don't provide the exact image sizes for each OS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!