#include "ltdoc2.h"
L_LTDOC2_API L_INT L_Doc2GetRecognizedCharactersColorsExt(hDoc, nDocId, nPageIndex, pClrs, pnClrsCount)
Gets the recognized characters colors.
Handle to the OCR document. This handle is obtained by calling the L_Doc2StartUp function.
Document ID created by calling L_Doc2CreateDocument.
Zero-based index of the page.
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. |
Getting the foreground and background colors for the recognized characters is a multi-step process.
Call the L_Doc2Recognize / L_Doc2RecognizeExt function to fill the RECOGCHARS2 structure with the indices for the foreground and background colors.
Next, call L_Doc2GetRecognizedCharacters / L_Doc2GetRecognizedCharactersExt in order to get the foreground and background colors.
Now call L_Doc2GetRecognizedCharactersColorsExt, passing NULL to _pClrs_, in order to get the elements count of the colors array.
Allocate the array of COLORREF.
Call L_Doc2GetRecognizedCharactersColorsExt again, this time passing the address of the allocated array to the pClrs parameter to get the colors.
Required DLLs and Libraries
For an example, refer to L_Doc2GetRecognizedCharactersExt.