我有一个包含5种图标大小的.ico文件,它被用作主应用程序图标和系统托盘图标。当它出现在任务栏中时,使用16x16格式的图标是期望的。但当图标出现在通知区域/系统托盘中时,它将使用32x32格式并缩小为16x16,看起来很糟糕。如何强制Windows在通知区域中使用16x16图标大小?以下是我用于将图标放入系统托盘的代码:
ContextMenu cmNotify = new ContextMenu();
MenuItem miNotify = new MenuItem(Properties.Resources.Notify_Text);
miNotify.DefaultItem = true;
miNotify.Click += new EventHandler(notifyHandler);
cmNotify.MenuItems.Add(miNotify);
notifyIcon = new NotifyIcon();
notifyIcon.Icon = this.Icon;
notifyIcon.Visible = true;
notifyIcon.ContextMenu = cmNotify;
notifyIcon.Text = AppConstants.APPLICATION_NAME;