Saturday, August 3, 2013

processing exercise: display image

To display image in Processing, the image file(s) have to be added in sketch's "data" folder. In Processing IDE, click Sketch from the menu bar, select Add File...



Browse to select the image file, click OK.


Example code:

PImage myImage;

void setup() {
  myImage = loadImage("Arduino-er2.png");
  size(myImage.width, myImage.height);
  smooth();
}

void draw() {
  image(myImage, 0, 0);
}

processing exercise: display image
processing exercise: display image


No comments:

Post a Comment