!7 static int w = 32, h = 16, ww = 400, hh = 200; static DirectSurface ds; static BufferedImage img; sbool continuous = true; sclass DirectSurface extends Surface { BufferedImage img; *() {} *(BufferedImage *img) {} public void render(int w, int h, Graphics2D g) { g.drawImage(img, 0, 0, null); } public Dimension getPreferredSize() { ret new Dimension(img.getWidth(), img.getHeight()); } } p-substance { img = newBufferedImage(ww, hh); showPackedFrame(ds = new DirectSurface(img)); thread { BufferedImage src = null; long screenshotTime = 0; repeat { if (!continuous && (src == null || sysNow() > screenshotTime+1000)) { src = screenshot(); screenshotTime = sysNow(); } for (int y = 0; y < hh; y += h) for (int x = 0; x < ww; x += w) { Dimension ss = screenSize(); int srcw = ss.width, srch = ss.height; int srcX = random(srcw-w), srcY = random(srch-h); if (continuous) drawImageOnImage(screenshot(srcX, srcY, w, h), img, x, y); else copyImagePart(src, srcX, srcY, img, x, y, w, h); ds.paintImmediately(x, y, w, h); sleep(50); } } } }