L_DocSelectZoneByPoint

#include "ltdoc.h"

L_LTDOC_API L_INT L_DocSelectZoneByPoint(hDoc, hDC, nPageIndex, pt, pnZoneIndex)

L_HDOC hDoc;

/* handle to the OCR document */

L_HDC hDC;

/* handle to the target device context */

L_INT nPageIndex;

/* page index */

POINT pt;

/* specifies the point */

L_INT * pnZoneIndex;

/* pointer to be updated */

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

Parameter

Description

hDoc

Handle to the OCR document.

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.

nPageIndex

Specifies the index of the page that contains the zones. This index is zero-based.

pt

Specifies the X and Y coordinates that specify a point inside a zone.

pnZoneIndex

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

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Draws a selection rectangle around the zone that contains the specified point.

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

To draw a page, call L_DocDrawPage.

Required DLLs and Libraries

LTDOC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_DocLockPage, L_DocUnlockPage, L_DocSetActivePage, L_DocDrawPage, L_DocSelectZone, L_DocRemoveSelectedZone, L_DocSetZonePen, L_DocSetSelectedZonePen, L_DocGetSelectedZone, L_DocZone

Topics:

OCR Functions: Drawing Zones and Pages

 

Drawing Pages and Zones

Example

 L_INT DocSelectZoneByPointExample(L_HDOC hDoc, HWND hWnd)
{
   L_INT nRet;
   HDC hdc = GetDC(hWnd);
   L_INT nSelZone = 0;
   POINT pt;
   pt.x = 450;
   pt.y = 400;

   nRet = L_DocSelectZoneByPoint(hDoc, hdc, 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;
}