Processing doesn't let me use the size of the image for the size of the window

I got the following code from a tutorial. I checked it with the reference and it should work.

The error I get is: "The size of this sketch could not be determined from your code. Use only numbers (not variables) for the size() command. Read the size() reference for more details.".

void setup(){ PImage img = loadImage("image.jpg"); size(img.width*2, img.height, P2D); }

Answers

Sign In or Register to comment.