Peforms OCR on the given rectangle on a specified image.


.Addon.OCRPro.RecognizeRect(sImageIndex, zone, asyncSuccessFunc, asyncFailureFunc);


<short> sImageIndex: specifies the index of image in buffer. The index is 0-based.
<ZoneArray> zone: specifies the coordinates of the rectangle. The structure is "{int left; int top; int right; int bottom;}".

Code snippet

var zoneArray = [];
var zone = Dynamsoft.WebTwain.Addon.OCRPro.NewOCRZone(_iLeft, _iTop, _iRight, _iBottom);
DWObject.Addon.OCRPro.RecognizeRect(0, zoneArray, GetRectOCRProInfo, GetErrorInfo);  

<OnOCRRectSuccess function> asyncSuccessFunc: callback function triggered when OCR is executed successfully. This is where you get the OCR result.

ZoneArray zonesReturns the zones on which OCR was performed.

OnOCRRectSuccess Function Prototype
short sImageIndex Returns the index of the OCR'd image.
OCRResult Result The OCR result for the image.

<OnOCRFailure function> asyncFailureFunc: callback function triggered when executing OCR fails.

OnOCRFailure Function Prototype
int ErrorCode Returns the error code.
string ErrorString Returns the error string.
OCRResult Result The OCR result for the image.