求助。关于重绘的问题
我做了个小东西
private void button2_Click(object sender, EventArgs e)
         {
             Bitmap bmp = new Bitmap(this.pictureBox1.ClientRectangle.Width, this.pictureBox1.ClientRectangle.Height);
             Graphics g = Graphics.FromImage(bmp);
             g.Clear(Color.Black);
             g.DrawRectangle(new Pen(Color.Red), 10, 10, 40, 20);
             g.Dispose();
             this.pictureBox1.Image = bmp;
        }
类似的吧。。。
然后呢。我想在pictureBox里先添加个图片再进行操作。
但是,执行上面的代码后,出现原来的图片没了,只有上面的操作了。去解决方法
------解决方案--------------------
你将原来的清除了,试试下面的
      private void button1_Click(object sender, EventArgs e)
       {
           Bitmap bmp = new Bitmap(pictureBox1.Image);
           Graphics g = Graphics.FromImage(bmp);         
           g.DrawRectangle(new Pen(Color.Red), 10, 10, 40, 20);
           g.Dispose();
           this.pictureBox1.Image = bmp;  
       }