etiennebalit / pyprocessing

Automatically exported from code.google.com/p/pyprocessing
2 stars 1 forks source link

Is loadPixels available in pyprocessing? #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
http://processing.org/reference/loadPixels_.html

How can I use the loadPixels in pyprocessing?

Thanks.

hbc
2011 July 28

Original issue reported on code.google.com by bcxxx...@gmail.com on 28 Jul 2011 at 3:19

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello,

Currently, loadPixels and updatePixels are only avaliable as PImage functions. 
You can still, however, manipulate the screen pixels with a simple workaround. 
All you need to do is to get a PImage copy of the screen, and then manipulate 
the pixels array of this object directly. After the manipulation is over, just 
display the PImage.

Example:
x = get()               #get() returns a PImage object which is a copy of the 
screen
x.img.format = 'RGBA'   #even though this line is necessary, you shouldn't mind 
it

Then you do all the pixels array manipulation you want to, but using "x.pixels" 
instead of "pixels".

image(x,0,0)            #lastly, you display the altered image

I'll try to implement loadPixels and updatePixels soon enough, so if you 
couldn't understand the workaround, just keep an eye on new releases (possibly 
tomorrow).

Thanks for the input.

Original comment by uo.strat...@gmail.com on 28 Jul 2011 at 10:30

GoogleCodeExporter commented 9 years ago
Thanks. =)

Original comment by bcxxx...@gmail.com on 29 Jul 2011 at 12:08

GoogleCodeExporter commented 9 years ago

Original comment by uo.strat...@gmail.com on 4 Aug 2011 at 1:59