Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 15, 2011 06:12 AM by savindra.bandi
Jul 04, 2004 09:50 PM|LINK
Jul 06, 2004 11:29 AM|LINK
Jul 06, 2004 11:45 AM|LINK
Jul 06, 2004 05:35 PM|LINK
Nov 19, 2007 01:42 PM|LINK
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. WHEN YOU TRY TO SAVE A BITMAP
you can not save the same Bitmap whihch you loaded into the object as it is bieng used by the other process at the same time....
So first rename it and then try to save....
//Step 6 : Try to save the image
// this file is exclusively locked by BITMAP process so PERHAPS error may occur so first prefix the s_ before image
//Now save this image
ObjBitmap.Save(TargetPath + "s_" + tmpFileName, System.Drawing.Imaging.ImageFormat.Jpeg);
//STEP 7 : CLEAN UP
//Destroy the Graphics Object
//DESTROY thE Bitmap Object and UNLOCK the file
//Delete the Temporarily Uploaded image
File.Delete(TargetPath + tmpFileName);
lblMessage.Text = "Stamping Done";
I hope this will be help full for you.... If you find this info helpfull please do not forget to mark it as answer
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
Apr 30, 2008 03:37 AM|LINK
If this error is caused by permissions then there are two possible scenarios:
Jan 14, 2009 09:18 AM|LINK
i did all solution but never solve this problem.
i gave full permission folder and dispose() all bitmap and grabhics. its nothing.
But i try this one : GC.Collect(); and its working. i think iis working process cannot permission overwrite same bitmap. Because
of bitmaps lifetime.
So i use Garbace Collector and solve this problem. My code is working fine.
Feb 01, 2009 09:46 AM|LINK
thanks man that worked
Sep 10, 2009 08:46 PM|LINK
Yea, just needed to do a .Dispose(); when done with the first System.Drawing.Image
Oct 09, 2009 05:28 AM|LINK
I know its very old post. I am just posting due to the reason if some one will search this error & ma get solution.
I was also facing same error, i did lots of R&D. Actually i was saving files in a temporary folder after uploading. After that i was performing some operations on the image and saving resultant image in a different folder and deleting file in temporary folder.
Actually temporary folder is empty, after publishing , that temporary folder does not exist in published project. so, for saving file temporarily, it is not getting path.
then i have manually created empty temporary folder in published folder.
its working f9 now.