modi

How to handle AccessViolationException

霸气de小男生 提交于 2020-03-10 04:40:50
问题 I am using a COM object (MODI) from within my .net application. The method I am calling throws a System.AccessViolationException, which is intercepted by Visual Studio. The odd thing is that I have wrapped my call in a try catch, which has handlers for AccessViolationException, COMException and everything else, but when Visual Studio (2010) intercepts the AccessViolationException, the debugger breaks on the method call (doc.OCR), and if I step through, it continues to the next line instead of

How to handle AccessViolationException

杀马特。学长 韩版系。学妹 提交于 2020-03-10 04:40:33
问题 I am using a COM object (MODI) from within my .net application. The method I am calling throws a System.AccessViolationException, which is intercepted by Visual Studio. The odd thing is that I have wrapped my call in a try catch, which has handlers for AccessViolationException, COMException and everything else, but when Visual Studio (2010) intercepts the AccessViolationException, the debugger breaks on the method call (doc.OCR), and if I step through, it continues to the next line instead of

PictureBox throws “Parameter is not valid” ArgumentException upon tab keypress

谁都会走 提交于 2020-01-03 17:38:06
问题 I have a form where the user can first scan to a bitmap. When scan is done, and the bitmap is loaded, I have 4 text boxes that are then enabled. Next to each text box, I have a button called "Cut from image". When the user clicks the button, they can click and drag in the bitmap to get the selected text using MODI. This works perfect except for one annoying bug: When I click a "Cut from image" button and drag a square, it gets the information nicely to the text box. Then, if i click to the

Windows 7 OCR API

孤街浪徒 提交于 2019-12-20 17:47:40
问题 I have been reviewing replacements for the Office 2007 MODI OCR (OneNote's 2010 solution has lesser quality/results than 2007 :-( ). I notice that Windows 7 contains an OCR library once you install the optional tiff filter The OCR component gets installed to %programfiles%\Common Files\microsoft shared\OCR\7.0\xocr3.psp.dll but I don't see any API for it? Does anyone see how this can be interfaced preferably in C#? ANSWER: Found the soluation, once the optional tiff ifilter win7 feature is

How to handle AccessViolationException

有些话、适合烂在心里 提交于 2019-12-16 19:53:14
问题 I am using a COM object (MODI) from within my .net application. The method I am calling throws a System.AccessViolationException, which is intercepted by Visual Studio. The odd thing is that I have wrapped my call in a try catch, which has handlers for AccessViolationException, COMException and everything else, but when Visual Studio (2010) intercepts the AccessViolationException, the debugger breaks on the method call (doc.OCR), and if I step through, it continues to the next line instead of

Using MODI to OCR in C#. Need to read images from memory, not disk

只谈情不闲聊 提交于 2019-12-08 09:35:01
问题 I'm trying to use MODI to perfom OCR on bitmaps I already have in memory. I can't seem to find a solution to this as all the examples I find use the create method to grab the image from the disk and prepares it for the OCR., however, I already have the image on memory and writing and reading i to and from the disk consumes too much time. Bitmap bmp = ... //Instantiate the MODI.Document object MODI.Document md = new MODI.Document(); //The Create method grabs the picture from disk snd prepares

“OCR running error” when using MODI 2003 with C#

牧云@^-^@ 提交于 2019-12-07 03:40:17
问题 I've been struggling to get MODI to work properly at all today. Here's the code I'm attempting to use (adapted from the VB given at the Wikipedia entry for MODI. private void button1_Click( object sender, EventArgs e ) { string inputFile = @"C:\testImage.bmp"; textBox1.Text = GetTextFromImage( inputFile ); } private string GetTextFromImage( string fileName ) { string output = ""; var doc1 = new MODI.Document(); doc1.Create( fileName ); doc1.OCR( MiLANGUAGES.miLANG_ENGLISH, false, false ); for

“OCR running error” when using MODI 2003 with C#

巧了我就是萌 提交于 2019-12-05 07:45:44
I've been struggling to get MODI to work properly at all today. Here's the code I'm attempting to use (adapted from the VB given at the Wikipedia entry for MODI . private void button1_Click( object sender, EventArgs e ) { string inputFile = @"C:\testImage.bmp"; textBox1.Text = GetTextFromImage( inputFile ); } private string GetTextFromImage( string fileName ) { string output = ""; var doc1 = new MODI.Document(); doc1.Create( fileName ); doc1.OCR( MiLANGUAGES.miLANG_ENGLISH, false, false ); for ( int i = 0; i < doc1.Images.Count; i++ ) { output += doc1.Images[i].Layout.Text; } doc1.Close();

.NET OCRing an Image

心已入冬 提交于 2019-12-03 12:58:00
问题 I'm trying to use MODI to OCR a window's program. It works fine for screenshots I grab programmatically using win32 interop like this: public string SaveScreenShotToFile() { RECT rc; GetWindowRect(_hWnd, out rc); int width = rc.right - rc.left; int height = rc.bottom - rc.top; Bitmap bmp = new Bitmap(width, height); Graphics gfxBmp = Graphics.FromImage(bmp); IntPtr hdcBitmap = gfxBmp.GetHdc(); PrintWindow(_hWnd, hdcBitmap, 0); gfxBmp.ReleaseHdc(hdcBitmap); gfxBmp.Dispose(); string fileName =

Windows 7 OCR API

江枫思渺然 提交于 2019-12-03 05:18:25
I have been reviewing replacements for the Office 2007 MODI OCR (OneNote's 2010 solution has lesser quality/results than 2007 :-( ). I notice that Windows 7 contains an OCR library once you install the optional tiff filter The OCR component gets installed to %programfiles%\Common Files\microsoft shared\OCR\7.0\xocr3.psp.dll but I don't see any API for it? Does anyone see how this can be interfaced preferably in C#? ANSWER: Found the soluation, once the optional tiff ifilter win7 feature is installed, i can then get a textoutput of a screenshot using the code/exe on http://www.codeproject.com