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

This function creates a multimedia instance from a filename using only the specified format.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_mult_open_file_format(
        LPSTR szFilename, 
        AT_MODE format,
        LPHIGMULT lphMult
);

Arguments:

Name Type Description
szFilename LPSTR Filename of multimedia to open.
format AT_MODE Format of file (can be IG_FORMAT_UNKNOWN).
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:

None

Example:

 
Copy Code
/* Get an animated GIF 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_format(szFile, IG_FORMAT_GIF, &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. Specifying the format lets you bypass the automatic file type identification for situations in which you know the format of the file.

See the multimedia API overview for a list of currently supported formats.