An Error Occured While Saving Scan Image
-
Hi Everybody, I have developed A Desktop Application in VS 2008. In This One Facility Is Provided To Scan The Document. Firstly It Was Working Fine , But Now A Days I Am Getting The Error a generic error occurred in gdi+ While Saving The File. I Have Set All The Permission To The File Where The Scanned Image Is Saved. I AM Unable To Resolve The Problem. Please Help Me To Solve My Problem. Thanks & Regards Sanket Patil :)
.
-
Hi Everybody, I have developed A Desktop Application in VS 2008. In This One Facility Is Provided To Scan The Document. Firstly It Was Working Fine , But Now A Days I Am Getting The Error a generic error occurred in gdi+ While Saving The File. I Have Set All The Permission To The File Where The Scanned Image Is Saved. I AM Unable To Resolve The Problem. Please Help Me To Solve My Problem. Thanks & Regards Sanket Patil :)
.
Without seeing the code where the error occurs, we're just guessing at this. But, from your vague description, it sounds like you loaded a file using the FromFile method of a Bitmap object and now are trying to save that same file to it's original filename. This doesn't work because the file is locked open for the entire lifetime of the Bitmap object. To get around this, you open the file using a FileStream object, then pass that stream to the contructor of your bitmap object, then close the file. This prevents the file from being locked and will allow you to dave the new image back to the original filename.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Hi Everybody, I have developed A Desktop Application in VS 2008. In This One Facility Is Provided To Scan The Document. Firstly It Was Working Fine , But Now A Days I Am Getting The Error a generic error occurred in gdi+ While Saving The File. I Have Set All The Permission To The File Where The Scanned Image Is Saved. I AM Unable To Resolve The Problem. Please Help Me To Solve My Problem. Thanks & Regards Sanket Patil :)
.
-
Hi Everybody, I have developed A Desktop Application in VS 2008. In This One Facility Is Provided To Scan The Document. Firstly It Was Working Fine , But Now A Days I Am Getting The Error a generic error occurred in gdi+ While Saving The File. I Have Set All The Permission To The File Where The Scanned Image Is Saved. I AM Unable To Resolve The Problem. Please Help Me To Solve My Problem. Thanks & Regards Sanket Patil :)
.