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.
IndexProgramming Questions & HelpSyntax Questions › pixels.length - upgrading code from 068 to Latest
Page Index Toggle Pages: 1
pixels.length - upgrading code from 068 to Latest (Read 1132 times)
pixels.length - upgrading code from 068 to Latest
May 4th, 2005, 3:47pm
 
Hi,

I was upgrading some old code up from 068 to the latest edition - I keep getting the following error (see below) whenever I have the call pixels.length in my code.

Any idea why? Is there something general I can do in my code to get round this? I'm currently going through my code replacing all pixels.length with width*height.

Code:

java.lang.NullPointerException
at Temporary_9176_9016.a_deposit(Temporary_9176_9016.java:118)
at Temporary_9176_9016$Particle.step(Temporary_9176_9016.java:92)
at Temporary_9176_9016.draw(Temporary_9176_9016.java:153)
at processing.core.PApplet.display(PApplet.java:1073)
at processing.core.PGraphics.requestDisplay(PGraphics.java:362)
at processing.core.PApplet.run(PApplet.java:918)
at java.lang.Thread.run(Unknown Source)
Re: pixels.length - upgrading code from 068 to Lat
Reply #1 - May 4th, 2005, 3:49pm
 
(update)
After comparing the two reference manuals I noticed that in 087 I apparently need to be calling loadPixels() and updatePixels() before I can use the pixels array. I'll see if that gets my code working.
Re: pixels.length - upgrading code from 068 to Lat
Reply #2 - May 4th, 2005, 5:41pm
 
you are aware that this stuff is covered here:

http://processing.org/faq/changes.html

right?
F
Page Index Toggle Pages: 1