OCRDIB Method

Description  

This function OCR the specified DIB.

Syntax                 RetVal = [BIOCR.] OCRDIB  hDIB pszOutText szLanguage bDetectOrientation

Returns               RetVal                          Integer          Returns with error status. OCR_OK (0) if successful. See other error codes in BiOCR.ocx specific error codes.

Remarks            

hDIB               LONGLONG Handle of the DIB to OCR

pszOutText    [out] String      The output text

szLanguage    String              The code of the language used for OCR. If multiple languages are used the language codes must be separated by ‘+’ character. The available languages can be retrieved by the GetOCRLanguages function. See the languages codes in the OCR languages section

bDetectOrientation    Boolean           If TRUE the function will detect the text orientation automatically.
                                                            If FALSE the function will assume that the text in the DIB is not rotated. (this mode is the faster)

Code example

// C# code

BIOCRLib.BiOCRClass ocrLib = new BIOCRLib.BiOCRClass();

BIDIBLib.BIDIBClass dibLib = new BIDIBLib.BIDIBClass();

int ret = 0;

long dib = 0;

string outputText = string.Empty;

 

// Load the image into DIB

dib = dibLib.LoadImageIntoDIB("c:\\Program Files\\Black Ice Software LLC\\Document Imaging SDK DEMO for Windows 32-bit\\Images\\TEST.TIF", 0);

 

// Check error

if (dib == 0)

    return;

 

// OCR the DIB

ret = ocrLib.OCRDIB(dib, out outputText, "eng", 1);

 

// Check error

if (ret != (int)BIOCRLib.OCR_ERRORS.OCR_OK)

    return;

 

// Process output text

//

// ...