DQBloadImage
FUNCTION

Prototype

DECLARE FUNCTION DQBloadImage (Layer AS INTEGER, x AS INTEGER, y AS INTEGER,
                               FileName AS STRING, Pal AS STRING, ImgWidth AS
                               INTEGER, ImgHeight AS INTEGER)

Parameters

Layer - Layer where to load the image onto

x - x position where to begin drawing

y - y position where to begin drawing

FileName - Image file name with full extension

Pal - String where the image palette is loaded into

ImgWidth - Integer variable to store the image width

ImgHeight - Integer variable to store the image height

Returns

An INTEGER value holding the loading results: > 0 Loading successful > 1 Cannot open file, or file does not exist > 2 General reading error > 3 Bad or unknown file format

Description

Loads an image into specified layer, at specified coordinates. Images can be of any size, up to 320x200 pixels, but it must have been saved with 256 colors. You can load BMP, PCX or BSAVEd files; the format is automatically detected and it's independent from the file extension. The function returns 0 if the operation is successful, otherwise an error code (see above). When loading a BMP or a PCX image, the palette is stored into the Pal string; current palette is not changed, allowing you to change it only when you want, by calling DQBsetPal or DQBfadeIn, or any way you like. In the case you're loading a BSV image, the function searches for the palette appended at the end of the file; if it finds it, you'll get it stored into the Pal string as well. In all cases, the image width and height will be stored into the ImgWidth and ImgHeight variables.

Notes:

See appendix C to know the palette string format