Can I use selectOutput() to create and write to an image with PImage.save() ?

So I have this:

PImage img;
void setup(){
  img = loadImage("rock.jpg");
  selectOutput("Select a file to write to:", "fileSelected");
}
void draw(){}
void fileSelected(File selection) {
  if (selection == null) {
    println("Window was closed or the user hit cancel.");
  } else {
    println("User selected " + selection.getAbsolutePath());
    PImage.save(selection.getAbsolutePath());
  }
}

and I was thinking it should work, however I'm just met with "Cannot make a static reference to the non-static method save(String) from the type PImage"

Is there a way to select save destination?

Answers

Sign In or Register to comment.