Different icon sizes of the operating system in Java

I just realized that different versions of windows use icons of different sizes for different purposes For example, the icon in the title bar of a window is much smaller than the program taskbar icon in Windows 7

Which icon sizes should my windows application's icon include? A very useful list of icon sizes, but I don't know how to provide them so that windows can choose the size required for some tasks

I would appreciate any advice or help on this matter I don't know how clear I am, so if someone asks me to clarify everything, please don't hesitate

In addition, if anyone knows whether this applies to MAC or how I adjust my code to apply to OS X, please tell me too

Update: This is my java swing application

Solution

See window setIconImages(List). Depending on the platform function, one of several images of different sizes can be used as the icon of the window File browser GUI thread has an example This image shows a small icon for the GUI and a larger icon when ALT tabbing between windows

If the image is not square, windows fills it

Java Web Start provides similar options for multiple size icons for desktop shortcuts and icons Menu item

Re: picture naming:

> fb-icon-16 × 16.png > fb-icon-32 × 32.png

Yes, select the file name to include size information for developer benefit We may call these pictures:

> icon-small. png > icon-medium. png

.. It will work JRE will select according to the actual size of the image measured after loading However, I strongly recommend adding - 16 to the icon image name × 16 and so on to make it clear The size of the "small icon" will change over time Cross equipment

The JRE or system will scale an image according to an algorithm that is not under the control of the developer For example, as described above

I have one Duke@R_795_2419 @The player attempts to get a track or album cover for the track being played It not only displays the image at the top of the sound track, but also sets it as a (single) frame icon Windows (at least) zooms to size and fills any non square image with transparency Windows can even handle PNG with partial transparency

Otoh, afaiu OS X do not display frame icons Decide by design I don't know if it will cause the icon to not display at all You need Mac's advice Master, better information there.

Since the system makes its own (not necessarily optimal) decision on how to scale icons, it is best to use as few icons as possible & try to provide icons of appropriate size for each platform If they have a common size or 3, you are lucky

See also: sizes of frame icons used in swing Q & A

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>