| | |
General GDI+ Error
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Jan 2008
Posts: 27
Reputation:
Solved Threads: 0
Hello,
I am getting a General GDI+ Error according to the Visual C# debugger. i have no idea as to how to handle this problem. I have a button which i click and a section of the screen is cut and put into a bitmap. This is converted into tiff format which is sent for OCR using MODI. The first time I click the button it works, however, when i click the button again, I get a the error. Here is the line it is being pointed to:
bitonalBitmap.Save(@"c:\Bitonal-Out.tif", imageCodecInfo, encoderParameters);
Can anyone help me please.
Thanks in advance.
I am getting a General GDI+ Error according to the Visual C# debugger. i have no idea as to how to handle this problem. I have a button which i click and a section of the screen is cut and put into a bitmap. This is converted into tiff format which is sent for OCR using MODI. The first time I click the button it works, however, when i click the button again, I get a the error. Here is the line it is being pointed to:
bitonalBitmap.Save(@"c:\Bitonal-Out.tif", imageCodecInfo, encoderParameters);
Can anyone help me please.
Thanks in advance.
•
•
Join Date: Jan 2008
Posts: 27
Reputation:
Solved Threads: 0
Sorry, should have posted that as well...
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at BitonalConverter.Form1.OCRProcess(Int32 StartX, Int32 StartY, Int32 EndX, Int32 EndY, String file) in C:\Documents and Settings\user\Desktop\Bitonal\BitonalImageConverter_src\Bitonal\Bitonal.cs:line 58
at BitonalConverter.Form1.Process_Click(Object sender, EventArgs e) in C:\Documents and Settings\user\Desktop\Bitonal\BitonalImageConverter_src\Bitonal\Bitonal.cs:line 111
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Maybe this will help... I tried to delete the Bitmap after and was getting a "File used in another process error" which i also posted on another thread
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at BitonalConverter.Form1.OCRProcess(Int32 StartX, Int32 StartY, Int32 EndX, Int32 EndY, String file) in C:\Documents and Settings\user\Desktop\Bitonal\BitonalImageConverter_src\Bitonal\Bitonal.cs:line 58
at BitonalConverter.Form1.Process_Click(Object sender, EventArgs e) in C:\Documents and Settings\user\Desktop\Bitonal\BitonalImageConverter_src\Bitonal\Bitonal.cs:line 111
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Maybe this will help... I tried to delete the Bitmap after and was getting a "File used in another process error" which i also posted on another thread
•
•
Join Date: Aug 2008
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
Do you dispose of all your resources after the 1st button click? Do you specify a filename or is it a static filename you are using? sorry for all the questions im trying to determine more or less what may be the cause of this exception
Please reply me for the solution.
![]() |
Similar Threads
- Help Porn Pop-Ups, Error #317 and a red circle icon with white X in Tray (Viruses, Spyware and other Nasties)
- Cannot find server or DNS Error - please help! (Viruses, Spyware and other Nasties)
- Identifying Drivers needed (Windows 95 / 98 / Me)
Other Threads in the C# Forum
- Previous Thread: on minimize
- Next Thread: Hiding seek bar in Media player control Using C# windows application
| Thread Tools | Search this Thread |
.net access algorithm angle array asp.net bitmap box broadcast c# capturing check checkbox client combobox control conversion csharp database databasesearch datagrid datagridview dataset datetime dbconnection degrees delegate design development disappear draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net image input install interface java libraries list loop marshalbyrefobject math monodevelop mouseclick movingimage msword mysql operator path pause photoshop php picturebox pixelinversion platform post programming radians regex remoting richtextbox server sleep socket sql statistics string study system.servicemodel table tcpclientchannel text textbox thread time timer update usb usercontrol validation virtualization visualbasic visualstudio webbrowser winforms wpf wpfc# xml





