3

Possible Duplicate:
A generic error occurred in GDI+, JPEG Image to MemoryStream

I have a PictureBox that has it's image loaded from database.

MemoryStream ms2 = new MemoryStream((byte[])reader[13]);
pbShenasname.Image = Bitmap.FromStream(ms2);
ms2.Close();

i want to save this image from PictureBox to a path in local hard drive by doing:

if (SFD.ShowDialog() == DialogResult.OK)
    pbShenasname.Image.Save(SFD.FileName,System.Drawing.Imaging.ImageFormat.Jpeg);

SFD is a saveFileDialog.

When i try this code get me an error for generic error GDI. How i can save it without errors?

Community
  • 1
  • 1

0 Answers0