Image和Icon的相互转化
时间:2010-09-09 来源:崔佃鹏
Image img = Image.FromHbitmap(icon.ToBitmap().GetHbitmap());
Graphics g = Graphics.FromImage(img);
g.DrawImage(img, 0, 0, img.Width, img.Height);
Font f = new Font("Verdana", 32);
Brush b = new SolidBrush(Color.Red);
g.DrawString("!!!", f, b,0, 0);
Icon icon = Icon.FromHandle(((Bitmap)img).GetHicon());
g.Dispose();
Graphics g = Graphics.FromImage(img);
g.DrawImage(img, 0, 0, img.Width, img.Height);
Font f = new Font("Verdana", 32);
Brush b = new SolidBrush(Color.Red);
g.DrawString("!!!", f, b,0, 0);
Icon icon = Icon.FromHandle(((Bitmap)img).GetHicon());
g.Dispose();
相关阅读 更多 +