If a multi-page image is associated with the external file, it loads a page of the specified index from an external file and returns it using the parameter lphIGear.
Copy Code
|
|
---|---|
AT_ERRCOUNT IG_mpf_page_get( [IN] HMIGEAR hMIGear, [IN] UINT nPage, [OUT] LPHIGEAR lphIGear ); |
Name | Type | Description |
---|---|---|
hMIGear | HMIGEAR | Handle to the allocated multi-page image. |
nPage | UINT | The index page to load. |
lphIGear | LPHIGEAR | Indicates where to return the image handle. |
Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.
All pixel formats supported by ImageGear for C and C++.
None
Copy Code
|
|
---|---|
AT_ERRCOUNT nErrCount; // Returned count of errors HMIGEAR hMPDoc; // Handle of multipage image HIGEAR hIGear; // Handle of the page image nErrCount = IG_mpi_create(&hMPDoc, 0); if(nErrCount == 0) { nErrCount = IG_mpi_file_open("multipage.tif", hMPDoc, 0, IG_MP_OPENMODE_READONLY); if(nErrCount == 0) { nErrCount = IG_mpf_page_get(hMPDoc, 0, &hIGear); if(nErrCount == 0) { //... // Destroy the image IG_image_delete(hIGear); } } // Destroy multipage document IG_mpi_delete(hMPDoc); } |
If a multi-page image is not associated with the external file, or a failure to load a page occurs, then an error is set. This function does not change the multi-page image.