C#画图闪烁

http://www.cnblogs.com/Cybean/archive/2012/01/12/2321014.html

 

其他方式:

    将图元控件中的内容分为经常刷新和很少刷新两部分。

    在控件上添加picturebox,将很少刷新的部分写道内存中存为bitmap,然后显示在pictureBox中。

   

      Bitmap bmp = ProfileBitmap(this._lilines, toltallength);
           this.pictureBox1.Image = bmp as Image;
        public Bitmap ProfileBitmap(List<ProfileLine> li_lines, double lineLength)
        {
            Bitmap bmp = new Bitmap(800, 600);
            Graphics g = Graphics.FromImage(bmp);
            DrawAxis(g);
            for (int i = 0; i <= this._lilines.Count - 1; i++)//绘制所有线
            {
                DrawOneProfileLine(g, li_lines[i]);
            }

            DrawGraduationX(g, lineLength); //添加横轴刻度
            DrawLengendItems(g, li_lines);//添加图例
            return bmp;
        }

 

posted on 2012-05-06 17:13  imihiro  阅读(422)  评论(0编辑  收藏  举报