Homework two:
sliced duck
PImage img;
PImage sourceImage;
public void setup(){
sourceImage = loadImage ("IMG_3200.png"); image (sourceImage, 0, 0, 500, 500);
}
public void draw(){
img = loadImage ("Park2.jpg"); int x = 30; int width = 440; int height = 11; img.resize(500, 500); for (int i = 40; i < 460; i = i +25) { copy(img, x, i, width, height, x, i, width, height); }
}
public void settings() { size(500, 500); } static public void main(String[] passedArgs) { String[] appletArgs = new String[] { "HA_slice" }; if (passedArgs != null) { PApplet.main(concat(appletArgs, passedArgs)); } else { PApplet.main(appletArgs); } }
}