ImageGear for C and C++ on Windows v19.5 - Updated
IG_REC_zone_insert
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Zone Support Functions > IG_REC_zone_insert

Inserts a new zone in the zone list of the hImage image.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_zone_insert(
   HIG_REC_IMAGE hImage,
   AT_INT nIndex,
   LPAT_REC_ZONE lpZoneInfo
);

Arguments:

Name Type Description
hImage HIG_REC_IMAGE Handle of the image.
nIndex AT_INT Index in the zone list where the new zone should be inserted. Use zero (0) to insert the zone as the first element of the zone list. To insert a zone as the last element of the zone list, use the IG_REC_zones_count_get function to get (and use) the number of zones in the list.
lpZoneInfo LPAT_REC_ZONE Pointer to the zone data to be inserted.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

See IG_REC_image_import.

Example:

 
Copy Code
AT_ERRCOUNT ErrCount = 0;
HIG_REC_IMAGE higRecImage = 0;
HIGEAR higImage = 0;
AT_INT iZoneCount = 0;
AT_REC_ZONE rzInfo;

ErrCount += IG_load_file("Multipage.tif", &higImage); 
ErrCount += IG_REC_image_import(higImage, &higRecImage);
ErrCount += IG_REC_zones_locate(higRecImage, NULL);

memset(&rzInfo, 0, sizeof(AT_REC_ZONE));
rzInfo.Rect.left = 0; 
rzInfo.Rect.top = 0; 
rzInfo.Rect.right = 100; 
rzInfo.Rect.bottom = 100; 
rzInfo.FillingMethod = IG_REC_FM_OMNIFONT; 
rzInfo.RecognitionModule = IG_REC_RM_OMNIFONT_MOR; 
rzInfo.Filter = (enumIGRecChrFilter)(IG_REC_FILTER_UPPERCASE | IG_REC_FILTER_LOWERCASE); 
rzInfo.Type = IG_REC_WT_FLOW;
ErrCount += IG_REC_zone_insert(higRecImage, 0, &rzInfo);

ErrCount += IG_REC_image_delete(higRecImage);
ErrCount += IG_image_delete(higImage);

Remarks:

  1. After zone insertion, the zone list is recalculated automatically.
  2. When inserting a zone, the application should directly initialize the Rect, FillingMethod, Filter, and the Type fields of the zone, since they will not take on their default values.
  3. The type field of the zone to be inserted should be one of the following: IG_REC_WT_FLOW, IG_REC_WT_TABLE, or IG_REC_WT_GRAPHIC.
  4. For successful zone insertion, the whole zone area must lie within the hImage image area, and the top left coordinates of the zone must have lower values than those of the bottom right ones.
  5. It is the programmer's responsibility to specify a valid recognition module-filling method pair. Any incorrectly set zone will have no recognition result. For more detail see the Recognition module specifications.
  6. Calling this function disables the non-gridded table detection algorithm, independently from the nongridded table detection setting. For more detail see the IG_REC_decomp_nongridded_table_detect_set function.

See Also

HIG_REC_IMAGE