Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 pygame pixel array color swap?
Index -> Programming, Python -> Python Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
coolgod




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Python -> Python Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: