ImageGear for C and C++ on Windows v19.10 - Updated
IG_mpf_page_count_get
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.

Declaration:

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

Arguments:

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

Sample:

MFC Multipage

Example:

 
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);

Remarks:

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