You are not logged in.
Hello
I try to paint a PNG Image with this Code
#include <grrlib.h> #include <stdlib.h> #include <wiiuse/wpad.h> int main(int argc, char **argv) { GRRLIB_Init(); // Initialise the Graphics & Video subsystem WPAD_Init(); // Initialise the Wiimotes WPAD_SetDataFormat(WPAD_CHAN_ALL, WPAD_FMT_BTNS_ACC_IR); WPAD_SetVRes(WPAD_CHAN_ALL, rmode->fbWidth, rmode->xfbHeight); GRRLIB_texImg *background; GRRLIB_texImg *cursor; GRRLIB_texImg *singleplayer; background = GRRLIB_LoadTextureFromFile("images/background.jpg"); cursor = GRRLIB_LoadTextureFromFile("images/cursor.png"); singleplayer = GRRLIB_LoadTextureFromFile("images/one.png"); int x, y; while(1) { x = WPAD_Data(0)->ir.x; y = WPAD_Data(0)->ir.y; WPAD_ScanPads(); // Scan the Wiimotes if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) { break; } GRRLIB_DrawImg(0, 0, background, 0, 1, 1, RGBA( 255, 255, 255, 255 )); GRRLIB_DrawImg(x, y, cursor, 0, 1, 1, RGBA( 255, 255, 255, 255 )); GRRLIB_DrawImg(50, 50, singleplayer, 0, 1, 1, RGBA( 255, 255, 255, 255 )); GRRLIB_Render(); // Render the frame buffer to the TV } GRRLIB_Exit(); exit(0); }
The JPG Image is shown but the PNG Images aren't. Has anyone an idea why I can'T see the pictures? They have transparency and 32 Bit but that isn't the problem??
Greetings
Crosaider
P.S: Sorry for my terrible English - I'm from Germany
Offline
Hi, what is the Width and Height of the image?
Offline
The first has 37x52 Pixel (cursor.png) and the second 285x156 Pixel (one.png)
Offline
The width and height needs to be multiples of 4. That's not the case for 37 and 285.
When you load files from SD card it's best to add sd:/ before the path. ie:
background = GRRLIB_LoadTextureFromFile("sd:/images/background.jpg");
Offline