We are about to switch to a new forum software. Until then we have removed the registration on this forum.
This code throws an error: "Uncaught Error using image in background(): PImage not loaded. "
PImage bgImage; // display window image
void setup() {
size(800, 800);
bgImage = createImage(width, height, RGB);
}
void draw() {
background(bgImage);
}
I cant understand why or how to fix it... Anyone plz?
Answers
insert this at end ofg setup()
Hi Chrisir, thanks for your answer. I have also fixed it by loading a transparent image. Your solution is as good. But I still dont understand why an empty image doesnt work, nor can I find any bug report of this one...
The original code doesn't throw any exceptions for me in both Processing versions: 2.0.2 & 1.5.1! ;;)
There was a thread, not so long ago, about this problem. The image isn't "empty", it is uninitialized. It is like trying to use an array of objects without filling it, etc.
Ok thanks PhiLho.