title: Saving Image from a picture box ,image was drawn by graphics object
body: <p>I have this code throwing exception on "pictureBox2.Image.Save(st + "patch1.jpg");" I think there is nothing saved on pictureBox2.Image ,But I have created graphics g on it.
  how do I save the image of pictureBox2.Image?</p>
  
  <pre><code>        Bitmap sourceBitmap = new Bitmap(pictureBox1.Image, pictureBox1.Width, pictureBox1.Height);
          Graphics g = pictureBox2.CreateGraphics();
          g.DrawImage(sourceBitmap, new Rectangle(0, 0, pictureBox2.Width, pictureBox2.Height),rectCropArea, GraphicsUnit.Pixel);
          sourceBitmap.Dispose();
          g.Dispose();
          path = Directory.GetCurrentDirectory();
          //MessageBox.Show(path);
          string st = path + "/Debug";
          MessageBox.Show(st);
          pictureBox2.Image.Save(st + "patch1.jpg");
  </code></pre>