#include "ltdoc2.h"
L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2GetZone(hDoc, nPageIndex, nZoneIndex, pZoneData, uStructSize)
Gets information about the zone at the specified index in the zone list of the specified page.
Handle to the OCR document
Index of the page from which to get the zone information. This is a zero-based index.
Index of the zone for which to get the information. This is a zero-based index.
Pointer to a ZONEDATA2 structure that will be updated with zone information.
Size in bytes, of the structure pointed to by pZoneData, use sizeof(ZONEDATA2) to calculate this value.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To remove a specific zone, call the L_Doc2RemoveZone / L_Doc2RemoveZoneExt function.
To add a zone, call the L_Doc2AddZone / L_Doc2AddZoneExt function.
Required DLLs and Libraries
L_INT Doc2GetZoneExample(L_HDOC2 hDoc,
L_INT nPageIndex,
L_INT nZoneIndex)
{
L_INT nRet;
ZONEDATA2 ZoneData;
ZeroMemory(&ZoneData, sizeof(ZONEDATA2));
nRet = L_Doc2GetZone(hDoc, nPageIndex, nZoneIndex, &ZoneData, sizeof(ZONEDATA2));
if (nRet != SUCCESS)
{
MessageBox(NULL, TEXT("Couldn't get the specified zone information."), TEXT("Error!"), MB_OK);
return nRet;
}
if (ZoneData.FillMethod != DOC2_FILL_OCRA)
ZoneData.FillMethod = DOC2_FILL_OCRA;
if (ZoneData.Type != DOC2_ZONE_GRAPHIC)
ZoneData.Type = DOC2_ZONE_GRAPHIC;
nRet = L_Doc2UpdateZone(hDoc, nPageIndex, nZoneIndex, &ZoneData);
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("The specified zone is updated."), TEXT("Notice!"), MB_OK);
else
return nRet;
return SUCCESS;
}