Computer Science Canada pygame pixel array color swap? |
Author: | coolgod [ Fri Feb 04, 2011 2:21 am ] |
Post subject: | pygame pixel array color swap? |
if i'm using pygame pixearray and i do like pxarray=PixelArray(canvas) #canvas is my surface and i set pxarray[0][0]=(255,0,0) it changes it to blue instead. A user reported issue b4 and said " I had this weird thing where blue/red was inversed, but not the other colours, when I was mapping some pixels from one image to a blank surface. It was caused by copying the color integer directly to one pixel to the other, so the trick is to always surface.unmap_rgb(pixel) before setting the color to a new pixel " I don't exactly how i can set that pixel color to blue using pixel array. i searched it up and I think it had something to do with sdl stuff. Someone help me? http://sdl.beuc.net/sdl.wiki/FAQ_GUI |