62,025
社区成员
发帖
与我相关
我的任务
分享
string path = Server.MapPath("images/p002.jpg");
string text = "哈哈哈哈哈哈哈";
int alpha = 200;//透明度 0~255
System.Drawing.Image image = System.Drawing.Image.FromFile(path);
Graphics g = Graphics.FromImage(image);
Font f = new Font("italic", 15, FontStyle.Italic);//FontStyle.Italic斜体
Brush b = new SolidBrush(Color.FromArgb(alpha, Color.Red));
SizeF s = g.MeasureString(text, f);
g.DrawString(text, f, b, image.Width - s.Width, image.Height - s.Height);
image.Save(Response.OutputStream, ImageFormat.Jpeg);