#include "ltdoc2.h"
L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2Zone(hDoc, nPageIndex, nZoneIndex, lpArea)
Updates the specified zone area in the specified page.
Handle to the OCR document.
Page index. This index is zero-based.
Zone index that will be updated. This index is zero-based.
Pointer to the Windows RECT structure, which contains the new zone area.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To update general zone information, call the L_Doc2UpdateZone / L_Doc2UpdateZoneExt function.
✎ NOTE
If the zone is OCR zone, then this function will not update the zone area.
Required DLLs and Libraries
L_INT Doc2ZoneExample(L_HDOC2 hDoc,HWND hWnd)
{
L_INT nRet;
HDC hdc = GetDC(hWnd);
L_INT nSelZone = 0;
POINT pt;
pt.x = 450;
pt.y = 400;
nRet = L_Doc2SelectZoneByPoint(hDoc, hdc, 0, pt, &nSelZone);
if (nRet == SUCCESS)
{
ZONEDATA2 ZoneData;
ZeroMemory(&ZoneData, sizeof(ZONEDATA2));
// gets the zone data for the current selected zone...
nRet = L_Doc2GetSelectedZone(hDoc, 0, &ZoneData, sizeof(ZONEDATA2));
if (nRet == SUCCESS)
{
// update the area for the current selected zone...
ZoneData.rcArea.left += 10;
ZoneData.rcArea.top += 10;
ZoneData.rcArea.right += 50;
ZoneData.rcArea.bottom += 50;
nRet = L_Doc2Zone(hDoc, 0, nSelZone, &ZoneData.rcArea);
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("The selected zone area is updated."), TEXT("Notice!"), MB_OK);
}
else
return nRet;
ReleaseDC(hWnd, hdc);
}
else
return nRet;
return SUCCESS;
}