Saving image to file

You could try to save the image using this approach

SaveFileDialog dialog=new SaveFileDialog();
if (dialog.ShowDialog()==DialogResult.OK)
{
   int width = Convert.ToInt32(drawImage.Width); 
   int height = Convert.ToInt32(drawImage.Height); 
   using(Bitmap bmp = new Bitmap(width, height))
   {
       drawImage.DrawToBitmap(bmp, new Rectangle(0, 0, width, height));
       bmp.Save(dialog.FileName, ImageFormat.Jpeg);
   }
}

Leave a Comment