学海无涯

导航

抗锯齿显示

 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;//搞锯齿呈显

 没有启用搞锯齿模式

 

posted on 2024-01-13 11:14  宁静致远.  阅读(7)  评论(0编辑  收藏  举报