5.4. Saving an image to a bmp or png file.
You can save an image to a 24 bits .bmp or .png file.
void TCODImage::save(const char *filename)
void TCOD_image_save(TCOD_image_t image, const char *filename)
image_save(image, filename)
void TCODImage::save(string filename)
Parameter | Description |
---|---|
image | In the C version, the image handler, obtained with any image creation function. |
filename | Name of the .bmp or .png file. |
Example:
TCODImage *pix = new TCODImage(10,10);
pix->save("mypic.bmp");
TCOD_image_t pix = TCOD_image_from_console(my_offscreen_console);
TCOD_image_save(pix,"mypic.bmp");
pix = libtcod.image_from_console(my_offscreen_console)
libtcod.image_save(pix,"mypic.bmp")