|
|
|
|
MGL_loadPNG
Load a PNG bitmap file from disk.
Declaration
bitmap_t * MGLAPI MGL_loadPNG(
const char *PNGName,
ibool loadPalette)
Prototype In
mgraph.h
Parameters
PNGName |
Name of PNG file to load |
loadPalette |
True if you wish to load the images palette Only valid on PNG files with a bit depth of 8 or below |
Return Value
Pointer to the loaded PNG file, NULL on error.
Description
If you wish to load the bitmap as a different color depth or pixel format use the MGL_loadPNGIntoDC function.
When MGL is searching for PNG files it will first attempt to find the files just by using the filename itself. Hence if you wish to look for a specific PNG file, you should pass the full pathname to the file that you are interested in. If the filename is a simple relative filename (i.e. “MYBMP.PNG”), MGL will then search in the BITMAPS directory relative to the path specified in mglpath variable that was passed to MGL_init. As a final resort MGL will also look for the files in the BITMAPS directory relative to the MGL_ROOT environment variable.
If the PNG file was not found, or an error occurred while reading the PNG file, this function will return NULL. You can check the MGL_result error code to determine the cause.
See Also
MGL_unloadBitmap, MGL_availablePNG, MGL_getPNGSize, MGL_loadPNGIntoDC, MGL_savePNGFromDC, MGL_putBitmap, MGL_loadPNGExt
Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com