loadImage help required
in
Programming Questions
•
9 months ago
I am trying to load two images into Processing, but encountering problems. I have tried the Processing examples on the website, to no avail!
I tried this:
PImage img;
void setup() {
img = loadImage("left.JPG");
}
void draw() {
image(img, 0, 0);
}
That gives me just a small bit of the top left hand corner. It seemed to me that the window was not big enough, so I tried this:
PImage img;
void setup() {
PImage left = loadImage("left.JPG");
size(left.width, left.height);
}
and that leaves me with a grey screen, as does the other processing example. I've tried other variations, but usually met with NullPointerException, or a screen-freeze.
Would anyone be able to tell me where I am going wrong? Many thanks in advance!
1