Hi, i need to load 4 images and draw them in a window, but i get this error.
here’s my code
PImage image;
PImage image1;
PImage image2;
PImage image3;
String path ="";
void setup() {
size(360, 240);
text("click window to load an image", 100, 120);
}
void handleImage(File selection) {
if (selection==null) {
println ("Error: 404");
}
else {
path = selection.getAbsolutePath();
image = loadImage(path);
image1 = loadImage(path);
image2 = loadImage(path);
image3 = loadImage(path);
surface.setSize(image.width * 2, image.height * 2);
}
}
void mouseClicked() {
image = null;
selectInput("select an image", "handleImage");
}
void draw() {
if (image != null) {
image(image, 0, 0 );
image(image1, image.width, 0 );
image(image2, 0, image.height);
image(image3, image.width, image.height);
//image.filter(GRAY);
//treshold(image1, 1, image.width, 0 );
//ditherio(image2, 1, 0, image.height);
//ditherio(image3, 4, image.width, image.height);
}
}