ImageGear for C and C++ on Windows v19.1 - Updated
IG_mpi_create
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Multi Page Image Functions > IG_mpi_create

This function allocates and initializes a new multi-page image and returns its handle.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_mpi_create( 
        LPHMIGEAR lphMIGear, 
        UINT nPages 
);

Arguments:

Name Type Description
lpHMIGear LPHMIGEAR A pointer indicating where to return the handle of the allocated and initialized multi-page image.
nPage UINT The number of multi-page image pages that should be created.

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 */
nErrCount = IG_mpi_create( &hMIGear, 0 );
 ...
/* any operations with hMIGear */
nErrCount = IG_mpi_delete( hMIGear );

Remarks:

This new image is set with nPages. Each image is initialized with the default value NULL. If there is a failure, then the returned handle is NULL and an error is set.

The multi-page image is array of pages where each page is a HIGEAR object. All pages are numbered beginning with a 0 index, so that 0 - is the first page, 1 - is the second page, etc. If the image contains nCount number of pages, then its pages can be accessed through indexes 0 - nCount-1. The value of each page can be either NULL (default value) or value HIGEAR image.