我刚刚在图片上添加了文字。当我使用bitmapimage.save方法时,它只在浏览器中显示图像。但我希望它自动要求下载图像。我使用以下代码。
performBlock
答案 0 :(得分:0)
Bitmap bitMapImage = new
System.Drawing.Bitmap(Server.MapPath(imageurl));
Graphics graphicImage = Graphics.FromImage(bitMapImage);
graphicImage.SmoothingMode = SmoothingMode.AntiAlias;
graphicImage.DrawString(TextBox1.Text,
new Font("Times New Roman", 24, FontStyle.Bold),
new SolidBrush(Color.White), new Point(200, 350));
Response.ContentType = "image/jpeg";
bitMapImage.Save (Response.OutputStream, ImageFormat.Jpeg);