L_OcrPage_SetBitmap

#include "ltocr.h"

L_LTOCR_API L_INT EXT_FUNCTION L_OcrPage_SetBitmap(page, bitmapHandle, freeOriginalBitmap)

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

Updates the page bitmap data from a BITMAPHANDLE object.

Parameter Description
page Handle to the OCR page.
bitmapHandle A BITMAPHANDLE that contains the image data that will be copied into this L_OcrPage.
freeOriginalBitmap an option to determine whether to free the current page bitmap handle.

Returns

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

LTOCR
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Advantage OCR C API Help