У меня есть этот код, выдающий исключение для "pictureBox2.Image.Save(st + "patch1.jpg");" Я думаю, что на pictureBox2.Image ничего не сохранено, но я создал на нем графику. как сохранить изображение pictureBox2.Image?
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");