Supported Browsers Home   
MGL_loadJPEGIntoDCExt Previous   
MGL_loadPCXExt Next   
External Functions Up   

MGL_loadPCX

Load a lightweight PCX file from disk.

Declaration

bitmap_t * MGLAPI MGL_loadPCX(
    const char *PCXName,
    ibool loadPalette)

Prototype In

mgraph.h

Parameters

PCXName

Name of PCX file to load

loadPalette

True if the palette should also be loaded

 

Return Value

Pointer to the loaded PCX file, NULL on error.

Description

Locates the specified PCX file and loads it into a lightweight bitmap structure. MGL can load any 1, 4, 8 or 24 bits per pixel PCX file.

If loadPalette is true, the palette values for the PCX will be loaded into the structure as well (if there is no palette, it will not be loaded), otherwise the palette entry for the PCX will be NULL. For small PCX files you can save space by not loading the palette for the PCX.

When MGL is searching for PCX files it will first attempt to find the files just by using the filename itself. Hence if you wish to look for a specific PCX 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.PCX”), 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 PCX file was not found, or an error occurred while reading the PCX file, this function will return NULL. You can check the MGL_result error code to determine the cause.

The routine allocates a lightweight bitmap structure for holding the PCX file, which loads the bitmap with the minimum memory overheads. You can draw the PCX file on any device context surface using the MGL_putBitmap function, but you don't have the full flexibility of using a memory device context for the bitmap surface. If you need more control over the bitmap, you can allocate a memory device context to hold the bitmap data and load the bitmap with the MGL_loadPCXIntoDC function.

See Also

MGL_unloadBitmap, MGL_availablePCX, MGL_getPCXSize, MGL_loadPCXIntoDC, MGL_savePCXFromDC, MGL_putBitmap, MGL_loadPCXExt

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