//C#往图片上面添加文字
string dir = System.Environment.CurrentDirectory + "\\html5\\PersonImg\\" + imagename + ".png";
if (File.Exists(dir))
{
FileStream fs = new FileStream(dir, FileMode.Open, FileAccess.Read,
FileShare.ReadWrite);
byte[] bytes = new byte[fs.Length];
fs.Read(bytes, 0, bytes.Length);
fs.Close();
MemoryStream ms = new MemoryStream(bytes);
Bitmap img = new Bitmap(ms);
Graphics g = Graphics.FromImage(img);
String str = DateTime.Now.ToString("f");
Font font = new Font("微软雅黑", 25);
SolidBrush sbrush = new SolidBrush(System.Drawing.Color.Black);
g.DrawString(str, font, sbrush, new PointF(1300, 30));
img.Save(dir, System.Drawing.Imaging.ImageFormat.Png);
}
//C#往图片上面添加文字