Click to See Complete Forum and Search --> : ExternalException - A generic error occurred in GDI+


ssice
December 23rd, 2009, 04:40 PM
I am loading an image into a picturebox using
picturebox1.Image = Image.FromFile()

and saving it by using

Bitmap bm = new Bitmat(pictureBox1.Image);
bm.Save(FileName, ImageFormat.Bmp);

It works perfectly fine when creating a new file, but the moment you try to replace the existing image I get thrown a
"ExternalException was unhandled - A generic error occurred in GDI+."

Anythoughts on what I am doing wrong? Being able to replace the existing file is an important step in my program.

Alright, I think i solved it by loading the image into a filestream, then loading the filestream into the picturebox.

vitagoni
January 1st, 2010, 10:40 AM
Srange solution, isn't it?