本文介绍了NotifyIcon的图像编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
NotifyIcon的图像编号.给我一些创建它的想法.
NotifyIcon将根据条件进行更改.图标将由某些数据自动创建.
从数字创建图标是个问题.
Number to Image for NotifyIcon. gimme some idea to create it.
NotifyIcon will be changed upon condition. Icon will be created automatically by some data.
Creating the icon from number is the problem.
推荐答案
Bitmap bmp = new Bitmap(16, 16);
using (Graphics g = Graphics.FromImage(bmp)) // Bmp with clear background of given color
Font drawFont = new Font("Arial", 16);
SolidBrush drawBrush = new SolidBrush(Color.Black);
string theNumber="8";
g.DrawString(theNumber,drawFont,drawBrush,new Point(100,100))
notifyIcon1.Icon = Icon.FromHandle(bmp.GetHicon());
另请参阅:
动态(安全地)生成图标 [ ^ ]
see also :
Dynamically Generating Icons (safely)[^]
这篇关于NotifyIcon的图像编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!