GrAPiC
Graphics for Algo/Prog in C/C++

◆ image() [1/2]

Image grapic::image ( const char *  filename,
bool  transparency = false,
unsigned char  r = 255,
unsigned char  g = 255,
unsigned  b = 255,
unsigned char  a = 255 
)
inline

Return an image loaded from the file filename.

struct Data
{
Image im;
};
void init(Data& d)
{
d.im = image("data/grapic.bmp", true, 255, 255, 255, 255); // load the image "data/grapic.bmp" with transparency for the color (255,255,255,255)
}
void draw(Data& d)
{
image_draw(d.im, 0, 255); // Draw the image with the left corner (0,255)
}
void image_draw(Image &im, int x, int y, int w=-1, int h=-1)
Draw the image at position (x,y) with width=w and height=h (if w<0 or h<0 the original size of the im...
Definition: Grapic.h:613
Image image(const char *filename, bool transparency=false, unsigned char r=255, unsigned char g=255, unsigned b=255, unsigned char a=255)
Return an image loaded from the file filename.
Definition: Grapic.h:587