ImageGear for C and C++ on Linux v18.8 - Updated
IG_load_tiles_stitch
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Load Functions > IG_load_tiles_stitch

This function loads and stitches together a tiled image, returning a HIGEAR handle to the image in memory.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_load_tiles_stitch(
   const LPSTR lpszFileName,
   UINT nPage,
   LPAT_STITCH lpStitch,
   LPHIGEAR lphIGear
);

Arguments:

Name Type Description
lpszFileName const LPSTR Set to the filename of the image to load and stitch.
nPage UINT Page number to load and stitch if this is a multi-page file. Note that page numbers begin at 1, not 0. Set nPage to 1 if this is not a multi-page file.
lpStitch LPAT_STITCH Set to a structure of type AT_STITCH, which defines the reference tile number, and the number of row and columns of tiles.
lphIGear LPHIGEAR ImageGear returns a HIGEAR handle to the newly stitched image in memory.

Return Value:

Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Example:

 
Copy Code
AT_ERRCOUNT nErrCount;
HIGEAR  hIGear = 0;
AT_STITCH stitch = {1, 1, 1};
CHAR* szFile = "picture.tif";
nErrCount = IG_load_tiles_stitch(szFile, 1, &stitch, &hIGear);

//...

// Destroy the image
if(IG_image_is_valid(hIGear))
{
    IG_image_delete(hIGear);
}

Remarks:

The AT_STITCH structure allows you to supply ImageGear with information on which tiles to use as the upper-left corner in the new stitched image, and how many tile rows and columns should be stitched together. For a graphical representation of how this works, see Working with Tiled Images.

The nPage argument is set to 1 or greater if you are loading from a multi-page file, to indicate which page (image) you want to load. Set nPage to 1 for a non-multi-page file.

If you set nPage to < 1, ImageGear will default the value to 1; if you set nPage to greater than the number of pages in the document, ImageGear will default the value to the last page number.

See also IG_load_tiles_stitch_FD, IG_load_tiles_stitch_mem, IG_tile_count_get functions.

For a complete discussion of working with tiled images see Working with Tiled Images.