2011-08-22 85 views

回答

4

您可以使用DrawString方法将文本写出到图像上。

// Create string to draw. 
String drawString = "Sample Text"; 

// Create font and brush. 
Font drawFont = new Font("Arial", 16); 
SolidBrush drawBrush = new SolidBrush(Color.Black); 

// Create point for upper-left corner of drawing. 
PointF drawPoint = new PointF(150.0F, 150.0F); 

// Draw string to screen. 
e.Graphics.DrawString(drawString, drawFont, drawBrush, drawPoint); 
3

目前尚不清楚,如果你想将文本添加到图像或只显示图像上的文字:

要将图像:

using (Graphics g = Graphics.FromImage(yourImage)) 
{ 
    g.DrawString(...); 
} 

或在Image:

e.Graphics.DrawImage(...); 
e.Graphics.DrawString(...); 
相关问题