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

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

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_mult_open_FD_format(
        AT_INT fd, 
        AT_MODE format, 
        LPHIGMULT lphMult
);

Arguments:

Name Type Description
fd AT_INT File descriptor.
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
/* Open an animated GIF file from a file descriptor */
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGMULT hMult;          /* Multimedia instance handle */
LPCSTR szFile;          /* Name of file to open */
HANDLE fd;              /* File descriptor */
AT_UINT numFrames;      /* Total number of frames in file */
AT_UINT duration;       /* Duration of file in milliseconds */
fd = CreateFile(szFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
nErrcount = IG_mult_open_FD_format(fd, IG_FORMAT_GIF, &hMult);
nErrcount = IG_mult_duration_get(hMult, &numFrames, &duration);
nErrcount = IG_mult_close(hMult);
CloseHandle(fd);

Remarks:

The file descriptor and contents 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.