Steve Wood
7/1/2007 12:38:00 AM
I'm using the Microsoft Office Document Imaging 11.0 Type Library and
performing OCR on images. What I'm doing is starting with a 1600x900 32-bit
image then using the system.drawing.bitmap class to extract smaller images
and then performing OCR on them. When I select a 480x28 pixel image it works
fine, but if I select a 400x24 pixel image I get the following message when I
go to get the text from the layout object:
Error: -2147467261: Attempted to read or write protected memory. This is
often a
n indication that other memory is corrupt.
Here's my code:
Dim tmpStr As String
Dim miDoc As MODI.Document
Dim miImage As MODI.Image
Dim miImageLayout As MODI.ILayout
miDoc = New MODI.Document
miDoc.Create(fileName)
miImage = miDoc.Images.Item(0)
miImage.OCR()
miImageLayout = miImage.Layout
tmpStr = miImageLayout.Text
Is there some restriction on the dimensions of the source image?