你f11
进去你的Form1 看看

解决方案 »

  1.   

    在这里使用using后会释放掉控件的Graphics绘图设备对象,之后再使用因为null值会抛出参数无效异常using (Graphics tg = e.Graphics)
    {
       tg.DrawImage(bufferimage, 0, 0);  //把画布贴到画面上
    }
    换成
    Graphics tg = e.Graphics
    tg.DrawImage(bufferimage, 0, 0);
      

  2.   

     using (Graphics tg = e.Graphics)e.Graphics别人还要用呢,不能释放
      

  3.   


             protected override void OnPaint(PaintEventArgs e)
            {
                g.SmoothingMode = SmoothingMode.HighQuality; //高质量
                g.PixelOffsetMode = PixelOffsetMode.HighQuality; //高像素偏移质量
                
                using ( Bitmap bufferimage = new Bitmap(this.Width, this.Height))
                {
                    Graphics tg = e.Graphics;
                    Rectangle rect = e.ClipRectangle;
                    Graphics g = Graphics.FromImage(bufferimage);
                    g.Clear(this.BackColor);
                    tg.DrawImage(bufferimage, 0, 0);  //把画布贴到画面上
                }
              }你原意是想把临时画布释放掉的。
      

  4.   


    悄悄地在尾巴加上bufferimage.Dispose();嘻嘻