抗锯齿显示

发布时间 2024-01-13 11:20:31作者: 宁静致远.
 protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            Graphics g = e.Graphics;
            g.SmoothingMode = SmoothingMode.HighQuality;//搞锯齿呈显
            Brush brush =new  SolidBrush(Color.Yellow);
            Rectangle rectangle= new Rectangle(0, 0, Width, Height);
            Region region = new Region(rectangle);
            Pen pen = new Pen(brush);
            g.DrawArc(pen,rectangle,500,600);
        }

 1.高质量模式 

g.SmoothingMode = SmoothingMode.HighQuality;//搞锯齿呈显

  

 g.SmoothingMode = SmoothingMode.AntiAlias;//搞锯齿呈显

 没有启用搞锯齿模式