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?
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.
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.
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.
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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With