任何人都有很好的示例,即如何将文本写在JPG图像上并使用System.NET绘制。

有帮助吗?

解决方案

是的,您可以很容易地做到这一点...

Bitmap bmp = new Bitmap("C:\\test.jpg");
Graphics gra = Graphics.FromImage(bmp);
string text = "Hello\nWorld";

gra.DrawString(text, new Font("Verdana", 24), Brushes.Black, new PointF(0, 0));
bmp.Save("C:\\test_out.jpg");

其他提示

从图像调用CreateGraphics()中获取图形,使用其Graphics.DrawString方法并根据需要保存。

更多信息:http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawstring.aspx

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top