We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am confused as to why this won't show an image. map.png is in the folder of the project
void setup() { size(400,400); USA = loadImage("map.png"); } void Draw() { background(0); image(USA,400,400); } PImage USA;
Processing doesn't recognize Draw() as 1 of its callbacks! I believe you've meant draw(), right? O:-)
https://processing.org/reference/draw_.html
@GoToLoop haha woops, well that fixed it! I also had to change the image function!
image() takes three parameters. The first in the PImage you want to draw. What do you think the next two are? So where is your image actually being drawn?
Hint: size(800,800);
image(USA, 400, 400); positions image's left-top @ canvas' 400x400 coordinates. Which is already outside canvas' 400x400 dimensions! Again I believe you've meant image(USA, 0, 0);! ;;)
image(USA, 400, 400);
image(USA, 0, 0);
https://processing.org/reference/image_.html
Answers
Processing doesn't recognize Draw() as 1 of its callbacks!
I believe you've meant draw(), right? O:-)
https://processing.org/reference/draw_.html
@GoToLoop haha woops, well that fixed it! I also had to change the image function!
image() takes three parameters. The first in the PImage you want to draw. What do you think the next two are? So where is your image actually being drawn?
Hint: size(800,800);
image(USA, 400, 400);
positions image's left-top @ canvas' 400x400 coordinates.Which is already outside canvas' 400x400 dimensions!
Again I believe you've meant
image(USA, 0, 0);
! ;;)https://processing.org/reference/image_.html