在picturebox画图,不用paint,先放在BMP的图片上,BMP上画一条直线,然后把图片放到picturebox上,怎么画呢?

解决方案 »

  1.   

    bitmap bmp=new bitmap(picturebox.width,picture.height);然后在bmp上怎么操作呢??
    谢谢大家帮忙
      

  2.   

       Bitmap _DrawBmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);            Graphics _Graphics = Graphics.FromImage(_DrawBmp);            Pen _Pen =new Pen(Brushes.Yellow,1);
                _Graphics.DrawLine(_Pen, new Point(0, 0), new Point(_DrawBmp.Width, _DrawBmp.Height));            _Graphics.Dispose();
                pictureBox1.Image = _DrawBmp;
      

  3.   

    我把这句话给漏了,pictureBox1.Image = _DrawBmp,唉~~
    还有想请问下:
    如果dispose()不加多次运行会累积吗?