BMP DisplayThe fg_showbmp() function displays an image stored in a BMP file. It can display an image such that its upper left corner is either at (0,0), or at the graphics cursor position in the active virtual buffer. The first fg_showbmp() parameter is the name of the BMP file (it may include a path name). The file name must be terminated with a null character, so Delphi programmers will need to store a zero byte as the last character of the file name string. The second parameter is a series of flags that controls how the image is displayed. The following table summarizes these flags.
The fg_showbmp() function returns 0 if successful, 1 if the specified file wasn't found, 2 if the file is not a BMP file, 3 if the BMP color depth is not compatible with the active virtual buffer's color depth, 4 if the BMP file is an unsupported RLE (compressed) BMP file, and 5 if there was an error allocating memory. The incompatible color depth error occurs when you try to display a 24-bit BMP file in a 256-color virtual buffer. For example, the code shown here will display the file LEAVES.BMP with its upper left corner at the screen space position (16,16) in the active virtual buffer, using the palette values stored in the BMP file, and with automatic color reduction disabled:
C/C++:
Delphi:
Visual Basic:
|
 
copyright 2001 Ted Gruber Software, Inc.