ImageGear for C and C++ on Windows v19.4 - Updated
IG_mult_open_file
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Multimedia Functions > IG_mult_open_file

This function creates a multimedia instance from a filename.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_mult_open_file(
        LPSTR szFilename, 
        LPHIGMULT lphMult
);

Arguments:

Name Type Description
szFilename LPSTR Filename of multimedia to open.
lphMult LPHIGMULT Handle to multimedia instance.

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:

This function does not process image pixels.

Sample:

Media Player

Example:

 
Copy Code
/* Get a multimedia file's duration using a filename */
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGMULT hMult;          /* Multimedia instance handle */
LPCSTR szFile;          /* Name of file to open */
AT_UINT numFrames;      /* Total number of frames in file */
AT_UINT duration;       /* Duration of file in milliseconds */
nErrcount = IG_mult_open_file(szFile, &hMult);
nErrcount = IG_mult_duration_get(hMult, &numFrames, &duration);
nErrcount = IG_mult_close(hMult);

Remarks:

The file must remain accessible until the multimedia instance is closed.