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

This function returns status information for the multi-page image, such as the association type, open mode, as well as others.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_mpi_info_get( 
        [IN] HMIGEAR hMIGear, 
        [IN] AT_MODE nMode, 
        [IN/OUT] LPVOID lpData,
        [IN] DWORD dwSize
);

Arguments:

Name Type Description
hMIGear HMIGEAR The handle to the allocated multi-page image.
nMode AT_MODE This argument is used to determine the type of information being retrieved.
lpData LPVOID The far pointer to the buffer indicating where to return the allocated data.
dwSize DWORD The size of the buffer.

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 */
HIGEAR hIGear;     /* handle of an image */
AT_MODE nAType;
CHAR FileName[_MAX_PATH];
 ...
/* initialize of multi-page image and assign it with external file */
nErrCount = IG_mpi_info_get( hMIGear, IG_MP_ASSOCIATION_TYPE , &nAType, sizeof(nAType) );
if( nAType== IG_MP_ASSOCIATE_FILE )
{
        IG_mpi_info_get( hMIGear, IG_MP_FILE_NAME, FileName, sizeof(FileName) );
}

Remarks:

The value of the parameters depends on nMode. The following table lists the possible combinations:

AT_MODE Constants Type of Third Argument dwSize Description
IG_MP_ASSOCIATION_TYPE LPAT_MODE Sizeof (AT_MODE) Returns the association type of the given multi-page image, which can be:
  • IG_MP_ASSOCIATE_NONE
  • IG_MP_ASSOCIATE_FILE
  • IG_MP_ASSOCIATE_MEMORY [not currently implemented]
IG_MP_OPENMODE LPAT_MODE Sizeof(AT_MODE) Returns the open mode of the associated file, which can be:
  • IG_MP_OPENMODE_NONE
  • IG_MP_OPENMODE_READONLY
  • IG_MP_OPENMODE_READWRITE
IG_MP_FILE_NAME LPCHAR Length of the buffer including last 0 byte Returns the name of the associated file.
[*]IG_MP_MEM_BUFFER_PTR LPBYTE 4 Returns a pointer to the memory associated with the multi-page image.
[*]IG_MP_MEM_BUFFER_SIZE LPDWORD 4 Returns the size of the associated memory.
IG_MP_FORMAT File format of the multi-page document. One of the enumIGFormats values.
IG_MP_DOCUMENT Native document associated with the multi-page document.