Resize() and SelectInput()

I'm using SelectInput() for the background of my sketch but with the current settings the given picture has to be 500x500 (size of the window), I'd like to use resize() to change any given picture to 500x500 and use it as background.

My current code is (in which background is a PImage)


void fileSelected(File selection) { if (selection == null) { println("Window was closed or the user hit cancel."); } else { background = loadImage(selection.getAbsolutePath()); } }


Any idea how to change this to use it with resize()?

Thanks!

Answers

Sign In or Register to comment.