Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Icon size for displaying in the tray

I am working on a Delphi program which will display an icon on the "tray". I am doing it "the hard way" (using the Shell_NotifyIcon api, etc and not a component, for reasons outside the point here). It's working fine but sometimes it seems like the icon is a little "blurry" in some systems. Now, I have experimented using 16x16 bmp, 32x32, etc. It seems like the system scales it down to the needed size, but the results are different depending on the OS version (or perhaps something else as well)....

Have any of you any experience about the best size and color depth of a BMP to be extracted and displayed on the tray using Shell_NotifyIcon from a ListImage?

like image 672
Lobuno Avatar asked Nov 11 '11 21:11

Lobuno


People also ask

What is the perfect size for an icon?

Icons work best at the power of 8. So always try and make your icon sizes divisible by 8 — this depends on what grid you're using, if you're using a 10x10 grid then make icons divisible by 10. For best results keep icon sizes consistent with your font sizes.

How do I choose icons in system tray?

Press the Windows key , type "taskbar settings", then press Enter . Or, right-click the taskbar, and choose Taskbar settings. In the window that appears, scroll down to the Notification area section. From here, you can choose Select which icons appear on the taskbar or Turn system icons on or off.

How many pixels should icons be?

Android Notification Icon Sizes Action Bar Icons require a file size of 24×24 pixels at the baseline size (MDPI). However, the image itself must be no more than 22×22 pixels centred within the Icon file.


2 Answers

You should be using 32bpp icons with partial transparency for best effect.

The icon uses the small system size. Get this by calling GetSystemMetrics passing SM_CXSMICON. If you use font scaling this can be, for example, 20px rather than the more common 16px. I've never found MS documentation for this fact but you can readily verify it for yourself by trial and error. Not really a happy state of affairs, but it is what it is.

Update: TOndrej points out that the docs for LoadIconMetric gives tacit approval of the notification area icon being small icon size. I don't understand why this information is not included with that for notification icons.

like image 122
David Heffernan Avatar answered Oct 07 '22 02:10

David Heffernan


You should probably include both 32x32 and 16x16 icons and load the appropriate one at runtime:

Notification area icons should be high-DPI aware. An application should provide both a 16x16 pixel icon and a 32x32 icon in its resource file, and then use LoadIconMetric to ensure that the correct icon is loaded and scaled appropriately.

(source: MSDN)

like image 25
Ondrej Kelle Avatar answered Oct 07 '22 02:10

Ondrej Kelle