p.noLoop();
int width = Math.min(1600, p.width * 4);
int height = Math.min(1200, p.height * 4);
PGraphicsJava2D canvas = (PGraphicsJava2D) p.createGraphics(width,
height, PConstants.JAVA2D);
canvas.beginDraw();
prettyHints(canvas);
canvas.background(255);
r.render(canvas, 0, 0, canvas.width, canvas.height,true);
canvas.endDraw();
canvas.loadPixels();