ImageGear Professional DLL v17.1 for Windows Accusoft
IG_mpi_page_count_get
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Multi Page Image Functions > IG_mpi_page_count_get

Glossary Item Box

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

Declaration:

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

Arguments:

hMIGear Handle to the allocated multi-page image.
lpPageCount 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 Professional.

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 i,
                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))
                        j++;
        }
printf("Number of valid pages is:%i", j);

Remarks:

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.

©2012. Accusoft Corporation. All Rights Reserved.