MGL_loadPCXIntoDC

Loads a PCX file directly into an existing device context.

Declaration

ibool MGLAPI MGL_loadPCXIntoDC(
    MGLDC *dc,
    const char *PCXName,
    int dstLeft,
    int dstTop,
    ibool loadPalette)

Prototype In

mgraph.h

Parameters

dc

Device context to load bitmap into

PCXName

Name of PCX file to load

dstLeft

Left coordinate to load PCX at

dstTop

Top coordinate to load PCX at

loadPalette

True if the palette should also be loaded

 

Return Value

True if the PCX file was loaded, false on error.

Description

Locates the specified PCX file and loads it into the specified device context at the specified destination coordinates. If the PCX is of a different pixel depth than the device context that it is being loaded into, the PCX will be converted as it is loaded to the pixel format of the device context it is being loaded into. 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 and stored in the device context's palette. If the device context being loaded into is the currently active display device, the palette will also be realized before the bits in the bitmap are loaded.

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

See Also

MGL_availablePCX, MGL_getPCXSize,MGL_loadPCX, MGL_savePCXFromDC

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