Implemented a PNG parser, now I support bmp (16, 24 and 32 bit), jpeg and all png formats.
Also implemented transparency.
The picture on the desktop was created using this code:
Code: Select all
//Picturebox
#define PB_ORIGINAL 0
#define PB_CENTERED 1
#define PB_STRETCH 2
#define PB_TILED 3
#define PB_ALIGNED 4
//WControl *ctrl_create_picturebox(CWindow *pWindow, int x, int y, int w, int h, char *szPath, uint32_t backcol, uint32_t mode)
ctrl_create_picturebox(pWindow, 50, 50, 800, 800, "B:\\DATA\\PICTURES\\test2.png", COL_TRANSLUCENT, PB_ORIGINAL);
Thats my first real GUI control element, I will add buttons etc soon
The background itself is a jpeg file which gets loaded depending on the resolution of the screen.
This way I can still scale up the pictures for unsupported resolutions, but support most resolutions with best quality available.
Original PNG picture:
https://upload.wikimedia.org/wikipedia/ ... tion_1.png