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

This function returns the number of pages in a multi-page image (the size of page array).


Copy Code
AT_ERRCOUNT ACCUAPI IG_mpi_page_count_get( 
        [IN] HMIGEAR hMIGear, 
        [OUT] LPUINT lpPageCount


Name Type Description
hMIGear HMIGEAR Handle to the allocated multi-page image.
lpPageCount LPUINT Pointer indicting where to return the number of pages of the given multi-page image.

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 nPageCount = 0; /* number of pages that should get from multi-page image */
                j = 0;
HIGEAR hIGear;    /* handle of an image */
/* initialize multi-page image and assign it with external file */
nErrCount = IG_mpi_page_count_get( hMIGear, &nPageCount );
for ( i = 0; i < nPageCount; i++ )
        if (!nErrCount)
                nErrCount = IG_mpi_page_get( hMIGear, i, &hIGear );
                if (IG_mpi_page_is_valid(hMIGear, i))
printf("Number of valid pages is:%i", j);


The HIGEAR handle of any given page is not significant in this function, other than to identify the image; this function simply counts the array size.

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