import java.awt.*; import java.awt.image.BufferedImage; import java.util.ArrayList; import javax.swing.*; /** * Custom rendering of an image, by animated blobs. * * @author Chris Bailey-Kellogg, Dartmouth CS 10, Spring 2016 */ public class PaintedImage extends DrawingGUI { private static final int numBlobs = 20000; // setup: how many blobs private static final int numToMove = 5000; // setup: how many blobs to animate each frame private BufferedImage original; // the picture to paint private BufferedImage result; // the picture being painted private ArrayList blobs; // the blobs representing the picture public PaintedImage(BufferedImage original) { super("Animated Picture", original.getWidth(), original.getHeight()); this.original = original; result = new BufferedImage(original.getWidth(), original.getHeight(), BufferedImage.TYPE_INT_ARGB); // Create a bunch of random blobs. blobs = new ArrayList(); for (int i=0; i=0 && x=0 && y