get null pointer exception for same code in draw that works fine above

edited August 2015 in Questions about Code
 In draw loop
 location,rr,cc all int
 rd,grn,blu all float

get null pointer error on first line that tries to set rd to red pixel value.

 location=rr*width+cc;  
 println(rr,cc,location);
 rd=red(pixels[location]);
 grn=green(pixels[location]);
 blu=blue(pixels[location]);
 println("RED="+rd,"GREEN+"+grn,"BLUE+"+blu);
Tagged:

Answers

Sign In or Register to comment.