#include "ltdoc2.h"
L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2GetRecognizedCharactersColors(hDoc, nPageIndex, pClrs, pnClrsCount)
Gets the recognized characters colors.
Handle to the OCR document. This handle is obtained by calling the L_Doc2StartUp function.
Index of the page. This is a zero-based index.
Address of an array of COLORREF to be updated.
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
For an example, refer to L_Doc2GetRecognizedCharacters.