对于使用 ListImage 中的 Shell_NotifyIcon 提取和显示在托盘上的 BMP 的最佳尺寸和颜色深度,你们有没有任何经验? 解决方案 为了获得最佳效果,您应该使用具有部分透明度的 32bpp 图标.图标使用较小的系统尺寸.通过调用传递 SM_CXSMICON 的 GetSystemMetrics 获取此信息.例如,如果您使用字体缩放,这可以是 20 像素而不是更常见的 16 像素.我从来没有找到关于这个事实的 MS 文档,但你可以通过反复试验很容易地自己验证它.不是一个真正愉快的事态,但它就是这样.更新: TOndrej 指出,LoadIconMetric 的文档默认通知区域图标是小图标尺寸.我不明白为什么通知图标中不包含此信息.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? 解决方案 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. 这篇关于在托盘中显示的最佳图标大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-18 20:15