首页 > 解决方案 > 如何调整通知图标的大小?

问题描述

_notifyIcon = new NotifyIcon();
_notifyIcon.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
_notifyIcon.BalloonTipClosed += (s, e) => _notifyIcon.Visible = false;      
_notifyIcon.Visible = true;
_notifyIcon.ShowBalloonTip(3000, "Title here", "Message displayed.",
                ToolTipIcon.None);

如果我将最后一行更改为TooltipIcon.Warning或其他任何内容(信息等),它将显示这样的大图:

看这里

但在我的情况下,我将假设我在通知中收到的图片太小的原因是因为它采用了原始大小(因为它是一个图标)。那么,如何调整它的大小呢?

标签: c#wpf

解决方案


.ico 文件可以包含多个不同分辨率的不同图像。似乎您需要为现有文件添加适当的分辨率,以便它显示适当的大小...有关更多信息,请参见以下链接... https://superuser.com/questions/491180/how-do- i-embed-multiple-sizes-in-an-ico-file

如果你使用 Visual Studio,它有一个内置的图标编辑器,支持嵌入多种分辨率。


推荐阅读