L_Doc2ZoneExt

#include "ltdoc2.h"

L_LTDOC2_API L_INT L_Doc2ZoneExt(hDoc, nDocId, nPageIndex, nZoneIndex, lpArea)

Updates the specified zone area in the specified page.

Parameters

L_HDOC2 hDoc

Handle to the OCR document.

L_INT nDocId

Document ID created by calling L_Doc2CreateDocument.

L_INT nPageIndex

Zero-based page index.

L_INT nZoneIndex

Zero-based zone index that will be updated.

LPRECT lpArea

Pointer to the Windows RECT structure containing the new zone area.

Returns

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

Comments

✎ NOTE

If the zone is an OCR zone, then this function will not update the zone area.

To update general zone information, call L_Doc2UpdateZone/l_doc2updatezoneext.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT Doc2ZoneExampleExt(L_HDOC2 hDoc, L_INT nDocId, HWND hWnd) 
{ 
   L_INT nRet; 
   HDC hdc = GetDC(hWnd); 
   L_INT nSelZone = 0; 
   POINT pt; 
 
   pt.x = 450; 
   pt.y = 400; 
 
   nRet = L_Doc2SelectZoneByPointExt(hDoc, hdc, nDocId, 0, pt, &nSelZone); 
   if (nRet == SUCCESS) 
   { 
      ZONEDATA2 ZoneData; 
 
      ZeroMemory(&ZoneData, sizeof(ZONEDATA2)); 
 
      // gets the zone data for the current selected zone... 
      nRet = L_Doc2GetSelectedZoneExt(hDoc, nDocId, 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_Doc2ZoneExt(hDoc, nDocId, 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; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - OmniPage Engine C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.