ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Multi Page Image File Functions > IG_mpf_page_count_get

Uses the IG_mpi_file_open() function to get the number of pages in the external file if it is associated with multi-page image.


Copy Code
AT_ERRCOUNT IG_mpf_page_count_get( 
        [IN] HMIGEAR hMIGear, 
        [OUT] LPUINT lpnPageCount


Name Type Description
hMIGear HMIGEAR Handle of the allocated multi-page image.
lpnPageCount LPUINT Pointer indicating where to return number of pages of the associated file.

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++.


Copy Code
HMIGEAR  hMIGear;      /* handle to multi-page image  */
AT_ERRCOUNT             nErrCount = IGE_SUCCESS; /* will hold returned error count */
UINT nPageCountI = 0; /* number of pages that should get from multi-page image */
UINT nPageCountF = 0; /* number of pages that should get from external source */
HIGEAR hIGear;      /* handle of an image */
/* initialize multi-page image and assign it with external file */
nErrCount = IG_mpi_page_count_get( hMIGear, &nPageCountI );
nErrCount = IG_mpf_page_count_get( hMIGear, &nPageCountF );
printf("Number of pages of multi-page image is:%i\n", nPageCountI);
printf("Number of pages of external source is:%i", nPageCountF);


If the file is not associated with a multi-page image file, the value is 0.

Is this page helpful?
Yes No
Thanks for your feedback.