Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS OCR C DLL Help

L_DocGetZone

Show in webframe

#include "ltdoc.h"

L_LTDOC_API L_INT L_DocGetZone(hDoc, nPageIndex, nZoneIndex, pZoneData, uStructSize)

L_HDOC hDoc;

/* handle to the OCR document */

L_INT nPageIndex;

/* page index */

L_INT nZoneIndex;

/* zone index */

pZONEDATA pZoneData;

/* pointer to a ZONEDATA structure */

L_UINT uStructSize;

/* size of the structure */

Gets information about the zone at the specified index in the zone list of the specified page.

Parameter

Description

hDoc

Handle to the OCR document.

nPageIndex

Specifies the index of the page from which to get the zone information. This is a zero-based index.

nZoneIndex

Specifies the index of the zone for which to get the information. This is a zero-based index.

pZoneData

Pointer to a ZONEDATA structure that will be updated with zone information.

uStructSize

Specifies the size of the structure pointed to by pZoneData, use sizeof(ZONEDATA) to calculate this value.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Retrieves zone information for the specified zone index in the specified page.

To remove a specific zone, call L_DocRemoveZone.

To add a zone, call L_DocAddZone.

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_DocAddZone, L_DocGetZoneCount, L_DocUpdateZone, L_DocRemoveZone, L_DocImportZones, L_DocExportZones, L_DocFindZones, L_DocSetZoneOptions, L_DocGetZoneOptions

Topics:

OCR Functions: Zones

 

Working with Zones

Example

 L_INT DocGetZoneExample(L_HDOC hDoc,
                                        L_INT nPageIndex,
                                        L_INT nZoneIndex)
{
   L_INT nRet;
   ZONEDATA ZoneData;
   ZeroMemory(&ZoneData, sizeof(ZONEDATA));

   nRet = L_DocGetZone(hDoc, nPageIndex, nZoneIndex, &ZoneData, sizeof(ZONEDATA));
   if (nRet != SUCCESS)
   {
      MessageBox(NULL, TEXT("Couldn't get the specified zone information."), TEXT("Error!"), MB_OK);
      return nRet;
   }

   if (ZoneData.FillMethod != FILL_OCRA)
      ZoneData.FillMethod = FILL_OCRA;

   if (ZoneData.Type != ZONE_GRAPHIC)
      ZoneData.Type = ZONE_GRAPHIC;

   nRet = L_DocUpdateZone(hDoc, nPageIndex, nZoneIndex, &ZoneData);
   if (nRet == SUCCESS)
      MessageBox(NULL, TEXT("The specified zone is updated."), TEXT("Notice!"), MB_OK);
   else
      return nRet;

   return SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.