We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › How to get current drawn pixels
Page Index Toggle Pages: 1
How to get current drawn pixels (Read 682 times)
How to get current drawn pixels
Feb 28th, 2008, 2:32pm
 
I'm writing a MovieMaker-like class and I have one question.
Hwo can I do to get current drawn pixels? (to write it to disk)? Can I do this with the loadPixels method in the JApplet object of the Sketch? What is the format of the byte array returned by this method?
Re: How to get current drawn pixels
Reply #1 - Feb 28th, 2008, 2:55pm
 
If you're writing a class within processing then it's just the pixels[] array that contains the data.
If it's an external class then you can get them by calling myPAppletObject.loadPixels(); and then accessing myPAppletObject.pixels[];

The format is one 32-bit int per pixel, ARGB.
Re: How to get current drawn pixels
Reply #2 - Feb 28th, 2008, 4:43pm
 
fog08 wrote on Feb 28th, 2008, 2:32pm:
Hwo can I do to get current drawn pixels (to write it to disk)


will saveFrame() do what you want

http://processing.org/reference/saveFrame_.html
Re: How to get current drawn pixels
Reply #3 - Feb 28th, 2008, 6:35pm
 
The loadPixels method and pixels fields suits me very well because I want to encode frames in movies (Theora format).

But with saveFrame I will not loose my time writing an video  encoder Smiley But it's written now so I'm trying to get it works.
Page Index Toggle Pages: 1