双缓冲技术

 

        //创建缓冲区域

        private BufferedGraphics bGrp = null;  

        //面板中创建画布
        Graphics grp = this.CreateGraphics();  
         //将缓冲区与面板绑定
         this.bGrp = BufferedGraphicsManager.Current.Allocate(grp, this.ClientRectangle);  
         //设置图形呈现的质量(可无)
         this.bGrp.Graphics.SmoothingMode = SmoothingMode.HighQuality; 
          //使用缓冲区画图
          this.bGrp.Graphics.FillEllipse(Brushes.Orange, rectF);  
          //将缓冲区内容写到设备
          this.bGrp.Render();  
posted @ 2019-04-30 22:23  NCat  阅读(131)  评论(0)    收藏  举报