< index
< 5. Image toolkit

=====================================
5.2 Loading a .bmp or .png image
=====================================

You can read data from a .bmp or .png file (for example to draw an image using the background color of the console cells).

C++ : TCODImage::TCODImage(const char *filename)
C   : TCOD_image_t TCOD_image_load(const char *filename)
Py  : image_load(filename)

ParameterDescription
filenameName of the .bmp or .png file to load.
Example :

C++ : TCODImage *pix = new TCODImage("mypic.bmp");
C   : TCOD_image_t pix = TCOD_image_load("mypic.bmp");
Py  : pix = libtcod.image_load("mypic.bmp")

insert a comment