c# 透明png 写入文字

string fileame = "c:/test.png";
//图片文字
string str = DateTime.Now.ToString("yyMMddHHmmss");

Bitmap image = new Bitmap(600, 400);
Graphics g = Graphics.FromImage(image);

//填充透明色
g.Clear(Color.Transparent);

//写文字
g.DrawString(str, new Font("宋体", 28), new SolidBrush(Color.Red), 40, 10);

//Graphics 类还有很多绘图方法可以绘制 直线、曲线、圆等等
image.Save(fileame , System.Drawing.Imaging.ImageFormat.Png);

posted @   過朢  阅读(53)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示