GetBitmapFromFile

int GetBitmapFromFile (char filename[], int *bitmapID);

Purpose

Reads a bitmap image from a file and creates a bitmap object. You can pass the bitmap ID this function outputs to any function that accepts a bitmap, such as CanvasDrawBitmap or ClipboardPutBitmap.

You can discard the bitmap object by passing its ID to DiscardBitmap.

You can use the following image types: .pcx, .bmp, .dib, .rle, .ico, .jpg, .png, .wmf, and .emf.

Regardless of the original color depth of the image file, the bitmap that GetBitmapFromFile creates matches the color depth of the display screen.

Parameters

Input
Name Type Description
filename string Pathname of the file that contains the image.

You can use a complete pathname or a simple filename. If the name is a simple filename, the file is loaded from the directory that contains the executable.
Output
Name Type Description
bitmapID integer ID that serves as a handle to the bitmap object.

You can pass the ID to CanvasDrawBitmap, ClipboardPutBitmap, or any other function that accepts a bitmap.

To discard the bitmap, pass the ID to DiscardBitmap.

Return Value

Name Type Description
status integer Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Code Error Message String
xx Success