OK, so I managed to find this libpng in order to get info about pixels on the PNG image. So i fill a char array with the RGB value of each pixel.
The image i read the information about the pixels is also 800x600 pixels.
Pixmap pix = XCreatePixmap(display, RootWindow(display, screen), 800, 600, DefaultDepth(display, screen));
pix = XCreateBitmapFromData (display, RootWindow(display, screen), (char*)img_bits, 800, 600);
However, in the Expose Event case, when I am doing :
XCopyArea(display, pix, window, DefaultGC(display, screen), 0, 0, 800, 600, 0, 0);
I am getting the following message:
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 62 (X_CopyArea)
Serial number of failed request: 19
Current serial number in output stream: 19
Why is he failing on this CopyArea thing ?
Thank you very much in advance.