L_Doc2SelectZoneByPointExt

#include "ltdoc2.h"

L_LTDOC2_API L_INT L_Doc2SelectZoneByPointExt(hDoc, hDC, nDocId, nPageIndex, pt, pnZoneIndex)

Draws a selection rectangle around the zone located at the specified point.

Parameters

L_HDOC2 hDoc

Handle to the OCR document.

L_INT nDocId

Document ID created by calling L_Doc2CreateDocument.

HDC hDC

Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.

L_INT nPageIndex

Zero-based index of the page that contains the zones.

POINT pt

The X and Y coordinates for a point inside a zone.

L_INT * pnZoneIndex

Pointer to a variable to be updated with the index of the selected zone.

Returns

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

Comments

This function returns the selected zone index if it finds a zone that contains the specified point.

To draw a page, call the L_Doc2DrawPage / L_Doc2DrawPageExt function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT Doc2SelectZoneByPointExampleExt(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) 
   { 
      L_TCHAR szBuffer[200]; 
      ZeroMemory(szBuffer, sizeof(szBuffer)); 
 
      wsprintf(szBuffer, TEXT("The selected zone index = %d\n"), nSelZone); 
      MessageBox(NULL, szBuffer, TEXT("Notice!"), MB_OK); 
   } 
   else  
      return nRet; 
 
   ReleaseDC(hWnd, hdc); 
   return SUCCESS; 
} 
Help Version 21.0.2021.1.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - OmniPage Engine C API Help