Bitmap bmp = new Bitmap(filename);
Graphics g = Graphics.FromImage(bmp);
String str = "hello, string";
Font font = new Font("宋体", 8);
SolidBrush sbrush = new SolidBrush(Color.Black);
g.DrawString(str, font, sbrush, new PointF(10, 10));
MemoryStream ms = new MemoryStream();
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);[C#] 在图片上添加文字
最新推荐文章于 2023-03-10 10:29:17 发布
本文介绍了如何在C#中使用Bitmap和Graphics类来绘制字符串,并将结果保存为BMP格式的内存流。通过实例演示了字符串绘制和图像保存的基本步骤。
2768

被折叠的 条评论
为什么被折叠?



