aho_10_image.pde
// To use this code, first use the "Sketch > Show sketch folder"
// menu command. Create a folder called "data" inside your sketch
// folder. Download the images called "icon_smiley.gif" and
// "icon_proce55ing.gif" from the course web site and put them
// in your data folder
BImage smile,p5;
void setup() {
size(300,300);
smile=loadImage("icon_smiley.gif");
p5=loadImage("icon_proce55ing.gif");
framerate(3);
}
void loop() {
for(int i=0; i<10; i++) {
for(int j=0; j<10; j++) {
if(random(100)>50) image(smile, i*30,j*30);
else image(p5, i*30,j*30);
}
}
}
|