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

This function gets the number of tiles constituting a page for file formats that support tiled pages.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_tile_count_get(
   const LPSTR lpszFileName,
   UINT nPageNum,
   LPUINT lpTileCountH,
   LPUINT lpTileCountV
);

Arguments:

Name Type Description
lpszFileName const LPSTR Path and name of the file for which to get the tile count. The path can be absolute or relative.
nPageNum UINT Page number for which to get the count of tiles.
lpTileCountH LPUINT Pointer to a UINT variable to receive the number of tiles horizontally (number of tiles in a row).
lpTileCountV LPUINT Pointer to a UINT variable to receive the number of tiles vertically (number of tiles in a column).

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
UINT nTileRows;            // Will receive number of tile rows
UINT nTileCols;            // Will receive number of tile cols
AT_ERRCOUNT nErrcount;  // Returned count of errors
// Get number of tiles, first page of file: 
nErrcount = IG_tile_count_get("picture_tiled.tif", 1, &nTileRows, &nTileCols );

Remarks:

The function returns 0 for both lpTileCountH and lpTileCountV if the image file format does not support tiled images.