Open li-zhixin opened 3 years ago
I'm using gdiplus to draw the button in a bitmap. The same code behaves differently on windows and linux. The core code is shown below.
public static Graphics GetHighQualityGraphic(this Bitmap bitmap) { var result = Graphics.FromImage(bitmap); result.CompositingQuality = CompositingQuality.AssumeLinear; result.SmoothingMode = SmoothingMode.AntiAlias; result.PixelOffsetMode = PixelOffsetMode.HighQuality; result.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; result.InterpolationMode = InterpolationMode.HighQualityBicubic; return result; } protected void DrawRoundRectangle(Graphics graphics, Pen pen, RectangleF rectangle, float radiusX, float radiusY = 0) { var mode = graphics.SmoothingMode; graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; graphics.DrawPath(pen, GetRoundRectangle(rectangle, radiusX, radiusY)); }
Is there anything I can offer or any helpful advice?Thanks.
I'm using gdiplus to draw the button in a bitmap. The same code behaves differently on windows and linux.
The core code is shown below.
Is there anything I can offer or any helpful advice?Thanks.