ImageGear for C and C++ on Windows v20.5 - Updated
IG_mpi_page_count_set
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Multi Page Image Functions > IG_mpi_page_count_set

This function sets the size of the page array of a valid multi-page image.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_mpi_page_count_set( 
        [IN] HMIGEAR  hMIGear, 
        [IN] UINT  nPageCount
);

Arguments:

Name Type Description
hMIGear HMIGEAR The handle to the allocated multi-page image.
nPageCount UINT The new number of pages.

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 i,
 ...
/* initialize of multi-page image and assign it with external file */
nErrCount = IG_mpi_page_count_get( hMIGear, &nPageCount );
if (!nErrCount)
{
        i = 0;
        while( !IG_mpi_page_is_valid(hMIGear, nPageCount - i - 1 ) && (i < nPageCount) )
                i++;
        }
        if (!nErrCount)
                nErrCount = IG_mpi_page_count_set( hMIGear, nPageCount - i );
}

Remarks:

If the size is increased, then new pages are initialized with a default value of NULL. If the array is reduced, then the removed pages are not deleted with the function IG_image_delete(). This function applies only to the image, but does not affect the associated file. The number of pages is not changed.

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