ImageGear Professional DLL v17.1 for Windows Accusoft
IG_REC_zone_rect_add
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Zone Support Functions > IG_REC_zone_rect_add

Glossary Item Box

Adds a new rectangle to an existing zone.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_zone_rect_add(
   HIG_REC_IMAGE hImage,
   AT_INT nZoneIndex,
   LPAT_RECT lpRect
);

Arguments:

hImage Image handle.
nZoneIndex Index of the zone to be updated.
lpRect The rectangle to be added to the given zone.

Return Value:

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

Supported Raster Image Formats:

See IG_REC_image_import.

Remarks:

Because the new rectangle can overlap previous rectangles, the function will recalculate the rectangle list of the zone. The resulting union must be a "pizza box" shape. Table zones and vertical text zones cannot receive new rectangles.

Example:

  Copy Code
AT_ERRCOUNT ErrCount = 0;
HIG_REC_IMAGE higRecImage = 0;
HIGEAR higImage = 0;
AT_INT iZoneCount = 0;
LPAT_RECT lpRects = 0;
AT_INT iRectNum = 0;

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

ErrCount += IG_REC_zones_count_get(higRecImage, &iZoneCount);
if(iZoneCount)
{
        ErrCount += IG_REC_zone_layout_get(higRecImage, 0, &lpRects, &iRectNum);
        if(iRectNum)
        {
            AT_RECT    rNewRect = lpRects[iRectNum-1];
            rNewRect.top = rNewRect.bottom;
            rNewRect.bottom = rNewRect.top + 100;
            rNewRect.left = (rNewRect.right + rNewRect.left) / 2;
            //...
            ErrCount += IG_REC_zone_rect_add(higRecImage, 0, &rNewRect);
        }
}

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

See Also

HIG_REC_IMAGE

©2012. Accusoft Corporation. All Rights Reserved.