bmap_save(BMAP*, STRING* name)
Saves a bitmap to an image
file.
Parameters:
BMAP* |
Bitmap pointer. |
name |
Image file name in .jpg, .png, .bmp, .dds,
or .tga format, STRING* or char*. |
Remarks:
- The file is saved to the current folder. It contains all modifications
applied during gameplay.
-
The allocated bitmap size (always a power of two) is saved in engine versions up to 7.85; from 7.86 on the size given in the BMAP definition is saved.
-
DirectX is used for saving the image; therefore some restrictions apply. The jpg quality can not be adjusted and the jpg image size must be a multiple of 8.
The bmp format can only be read back by bmap_load; it is saved in an unusual 32 bit format and thus can not be used for BMAP definitions or for textures.
Example:
function main()
{
wait(1); // video device must be openend for saving bitmaps
BMAP* b = bmap_createblack(123,456,24);
bmap_fill(b,vector(255,0,0),100);
bmap_save(b,"blue.png");
}
See also:
BMAP, bmap_purge, bmap_load
► latest
version online