我使用 Graphics.DrawString 方法在图像上写入文本,但保存图像后文本质量变得太低。这是我的代码:
Bitmap bitMapImage = new System.Drawing.Bitmap(Server.MapPath("~/k32.jpg"));
Graphics graphicImage = Graphics.FromImage(bitMapImage);
graphicImage.DrawString("string", font, s, new Point(10, 10));
graphicImage.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphicImage.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
graphicImage.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
graphicImage.TextContrast = 0;
Response.ContentType = "image/jpeg";
bitMapImage.Save(Server.MapPath("~/k33.jpg"), ImageFormat.Jpeg);
如何提高文本质量?谢谢