wpf 系统托盘中的图标大小是多少?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3531232/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the size of the icons in the system tray?
提问by Nam G VU
I want to change the notification icon of my application but don't know what is the size so as to make it properly displayed. Currently it is automatically resized and break my pixels! Please help!
我想更改我的应用程序的通知图标,但不知道大小是多少,以使其正确显示。目前它会自动调整大小并破坏我的像素!请帮忙!
回答by Quppa
In fact the size of the icon will vary according to the system DPI.
事实上,图标的大小会根据系统 DPI 而有所不同。
WPF exposes the recommended pixel width and height of small icons with SystemParameters.SmallIconWidthand SystemParameters.SmallIconHeight. (WinForms exposes the equivalent SystemInformation.SmallIconSize- both just wrap around GetSystemMetricsand SM_CXSMICON/SM_CYSMICON.)
WPF 使用SystemParameters.SmallIconWidth和SystemParameters.SmallIconHeight公开小图标的推荐像素宽度和高度。(WinForms 公开了等效的SystemInformation.SmallIconSize- 两者都围绕GetSystemMetrics和 SM_CXSMICON/SM_CYSMICON。)
回答by Android Eve
It's 16x16. If you create a .ico file that supports 16, 32, 48 and 256 sizes, you're covered.
它是 16x16。如果您创建了一个支持 16、32、48 和 256 大小的 .ico 文件,您就可以了。
回答by Fabian Fritz
For XP it's 16 x 16
对于 XP,它是 16 x 16
回答by David C
Outlook has an 16*16 pixels icon.
Outlook 有一个 16*16 像素的图标。
回答by YotaXP
I believe it has always been 16x16, but at some point between 98 and XP (Maybe it was CE vs NT?) they learned to support full color and alpha transparency. If you can, try to include a 256 color palleted version in the ICO for safe mode if not older versions of Windows.
我相信它一直是 16x16,但在 98 和 XP 之间的某个时间点(也许是 CE 与 NT?),他们学会了支持全色和 alpha 透明度。如果可以,如果不是旧版本的 Windows,请尝试在 ICO 中包含 256 色调色板版本以确保安全模式。
回答by lenooh
In ubuntu (unity) it seems to be 24x24 px.
在 ubuntu (unity) 中,它似乎是 24x24 像素。
回答by Usman Ilyas
Windows 7 has 16*16 pixels icons in system tray.
Windows 7 在系统托盘中有 16*16 像素的图标。