これにより、数秒間実行した後に OutOfMemory 例外が発生します。何か案は?
PGraphics img;
void setup() {
size(500, 500);
img = createGraphics(width, height, JAVA2D);
// this is here just for the testcase because else I get a
// NullPointerException too (probably a harmless Processing bug)
img.beginDraw(); img.endDraw();
}
void draw() {
PGraphics tmpImg = createGraphics(img.width, img.height, JAVA2D);
tmpImg.beginDraw();
tmpImg.image(img, 0, 0);
tmpImg.endDraw();
tmpImg.dispose();
}