MGL_getJPEGSize

Obtain the dimensions of a JPEG file from disk.

Declaration

ibool MGLAPI MGL_getJPEGSize(
    const char *JPEGName,
    int *width,
    int *height,
    int *bitsPerPixel,
    pixel_format_t *pf)

Prototype In

mgraph.h

Parameters

JPEGName

Name of the bitmap file to load header for

width

Place to store the bitmap width

height

Place to store the bitmap height

bitsPerPixel

Place to store the bitmap pixel depth

pf

Place to store the bitmap pixel format information

 

Return Value

True if the JPEG file was found, false if not.

Description

This functions loads all the header information for a JPEG file from disk, without actually loading the bits for the bitmap surface. This is useful to determine the dimensions and pixel format for the bitmap before it is loaded, so you can create an appropriate memory device context that you can load the bitmap into with the MGL_loadJPEGIntoDC function.

Note that JPEG files are inherently 24-bit, so when you call this function it will always return information for a 24-bit RGB pixel format image.

See Also

MGL_loadJPEG, MGL_loadJPEGIntoDC

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com