#include "ltdoc2.h"

L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2GetRecognizedCharactersColors(hDoc, nPageIndex, pClrs, pnClrsCount)

Gets the recognized characters colors.


L_HDOC2 hDoc

Handle to the OCR document. This handle is obtained by calling the L_Doc2StartUp function.

L_INT nPageIndex

Index of the page. This is a zero-based index.


Address of an array of COLORREF to be updated.

L_INT * pnClrsCount

Address of a variable to be updated with the number of elements in the array.


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


After calling the L_Doc2Recognize / L_Doc2RecognizeExt function, the RECOGCHARS2 structure contains index for foreground and background colors. So, you need to call this function after calling the L_Doc2GetRecognizedCharacters / L_Doc2GetRecognizedCharactersExt function to get the foreground and background color from the array that will be filled by calling this function.

Call this function by passing NULL to pClrs to get the elements count of colors array. Then allocate array of COLORREF and then call this function again by passing address of the allocated array to pClrs parameter to get the colors.

Required DLLs and Libraries

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

LEADTOOLS OCR Module - OmniPage Engine C API Help