Hello,
I have this issue with Processing 4.0b6/Windows.
This ultrasimple sketch triggers a NullPointerException when trying to display the image within draw(). Otherwise when displaying it within setup() it works fine. Also, the same image has been used in numerous other sketches. The sketch name doesn’t contain any special character.
What’s wrong???
PImage originImg;
void setup() {
size(800, 600);
noStroke();
frameRate(60);
PImage originImg = loadImage("flood_red_blue_1920x1080_bordure.png");
//image(originImg, 0, 0, width, height); // works flawlessly if executed here
}
void draw() {
image(originImg, 0, 0, width, height); // NullPointerException if executed here
}