L_OcrPage_SetBitmap

#include "ltocr.h"

L_LTOCR_API L_INT EXT_FUNCTION L_OcrPage_SetBitmap(page, bitmapHandle, freeOriginalBitmap)

Updates the page bitmap data from a BITMAPHANDLE object.

Parameters

L_OcrPage page

Handle to the OCR page.

BITMAPHANDLE* bitmapHandle

A BITMAPHANDLE that contains the image data that will be copied into this L_OcrPage.

L_BOOL freeOriginalBitmap

An option to determine whether to free the current page bitmap handle.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Once you create an OCR page, the bitmap data used to create the page is copied and stored inside the page. To get the bitmap handle that represents this page, use L_OcrPage_GetBitmap.

The bitmap handle object that the L_OcrPage_GetBitmap method returns contains a copy of the page image data in case you choose to get the processing bitmap. Any modifications you make to the bitmap handle will not affect the page. To update the page image data, you must call L_OcrPage_SetBitmap. Since the BITMAPHANDLE object is a copy in case you got the processing bitmap, you must free it by calling L_FreeBitmap method once you are done using it. But this does not apply to getting the original bitmap from the page, you can't free that bitmap handle if you choose the L_OcrBitmapSharingMode_AutoFree option when you created that page.

Once you obtain a BITMAPHANDLE object for this page, you can use it with other parts of LEADTOOLS, for example, you can use it to draw the bitmap inside your viewer window. You can also perform your own image processing on the page by getting the page btimap first using L_OcrPage_GetBitmap, apply some image processing operations on that bitmap like flipping it for example using L_FlipBitmap and then set it back to the page using L_OcrPage_SetBitmap.

Required DLLs and Libraries

Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - LEAD Engine C API Help