Open li-zhixin opened 3 years ago
Windows runs fine, but linux has different results.
Core Code As Follow:
var bitMap = new Bitmap(200, 200); using var graphics = Graphics.FromImage(bitMap); graphics.CompositingQuality = CompositingQuality.AssumeLinear; graphics.SmoothingMode = SmoothingMode.AntiAlias; graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit; graphics.DrawImage(Image.FromFile("./StaticFiles/Devil.png"), new Rectangle(0, 0, 200, 200)); graphics.DrawString("登录", new Font("新宋体", 20, FontStyle.Italic), new SolidBrush(Color.Black), 0, 50f); var stream = new MemoryStream(); bitMap.Save(stream, ImageFormat.Png); stream.Position = 0; return new FileStreamResult(stream, "image/png");
Is there a problem with my usage? Or is it a bug? Demo Project Here: WebApplication1.zip
Windows runs fine, but linux has different results.
Core Code As Follow:
Is there a problem with my usage? Or is it a bug? Demo Project Here: WebApplication1.zip