ImageGear for C and C++ on Windows v19.4 - Updated
IG_mpf_tile_count_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Multi Page Image File Functions > IG_mpf_tile_count_get

If the multi-page image is associated with an external file, then this function returns the tile information for the specified page number.

Declaration:

 
Copy Code
AT_ERRCOUNT IG_mpf_tile_count_get( 
        [IN] HMIGEAR hMIGear, 
        [IN] UINT nPage, 
        [OUT] LPUINT lpTileRows, 
        [OUT] LPUINT lpTileCols
);

Arguments:

Name Type Description
hMIGear HMIGEAR The handle of the multi-page image.
nPage UINT The page number from which to get the tile count.
LpTileRows LPUINT Pointer to a UINT variable to receive the number of tiles horizontally (number of tiles in a row).
LpTileCols LPUINT Pointer to a UINT variable to receive the number of tiles vertically (number of tiles in a column).

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

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

Sample:

MFC Multipage

Example:

 
Copy Code
HMIGEAR  hMIGear;     /* handle to multi-page image */
AT_ERRCOUNT             nErrCount = IGE_SUCCESS; /* will hold returned error count */
UINT nPageCount = 0; /* number of pages that should get from multi-page image */
UINT nTileRows;
UINT nTileCols;
 ...
/* initialize multi-page image and assign it with external file */
nErrCount = IG_mpf_page_count_get( hMIGear, &nPageCount );
/* Count number of tiles in the first page */
if (!nErrCount && nPageCount > 0)
        nErrCount += IG_mpf_tile_count_get(hMIGear, 0, &nTileRows, &nTileCols );
if (!nErrCount)
{
        printf( "Number of tiles in a row:%i\n", nTileRows );
        printf( "Number of tiles in a colomns:&i\n", nTileCols );
}       

Remarks:

An error is returned if the image is not associated with an external file. Pages are numbered starting with 0.