public PGraphics createGraphics(int w, int h) { return createGraphics(w, h, JAVA2D); }
public PGraphics createGraphics(int iwidth, int iheight) { return createGraphics(iwidth, iheight, JAVA2D); }
/** * Called in init(). Do not call manually except if you know what yeu do. */ protected void initGraphics() { this.graphics = (PGraphicsOpenGL) parent.createGraphics((int) (frameWidth * quality), (int) (frameHeight * quality), PApplet.OPENGL); }
public PGraphics createCanvas(int w, int h, String renderer, String fn) { PGraphics pg = app.createGraphics(w, h, renderer, fn); return pg; }
return createGraphics(w, h, renderer, null);
public PGraphics createCanvas(int w, int h, String renderer, int quality) { PGraphics pg = app.createGraphics(w, h, renderer); pg.smooth(quality); return pg; }
PApplet applet = new PApplet(); PGraphics g = applet.createGraphics(200, 400, PApplet.JAVA2D) // same params as size() g.beginDraw(); g.ellipse // ... etc, your drawing goes here g.endDraw(); g.save("filename.png");
/** * Set new resolution and re-init buffer. * * @param width New width of the pass buffer. * @param height New height of the pass buffer. */ @Override public void setResolution(int width, int height) { this.width = width; this.height = height; // init temp pass buffer passBuffers = new PGraphics[PASS_NUMBER]; for (int i = 0; i < passBuffers.length; i++) { passBuffers[i] = sketch.createGraphics(width, height, PApplet.P2D); passBuffers[i].noSmooth(); } resolution = new int[]{width, height}; }
/** * ( begin auto-generated from beginRecord.xml ) * * Opens a new file and all subsequent drawing functions are echoed to this * file as well as the display window. The <b>beginRecord()</b> function * requires two parameters, the first is the renderer and the second is the * file name. This function is always used with <b>endRecord()</b> to stop * the recording process and close the file. * <br /> <br /> * Note that beginRecord() will only pick up any settings that happen after * it has been called. For instance, if you call textFont() before * beginRecord(), then that font will not be set for the file that you're * recording to. * * ( end auto-generated ) * * @webref output:files * @param renderer PDF or SVG * @param filename filename for output * @see PApplet#endRecord() */ public PGraphics beginRecord(String renderer, String filename) { filename = insertFrame(filename); PGraphics rec = createGraphics(width, height, renderer, filename); beginRecord(rec); return rec; }
@Override public void init() { this.graphics = (PGraphicsOpenGL) parent.createGraphics((int) (frameWidth * quality), (int) (frameHeight * quality), PApplet.OPENGL); // screens = new ArrayList<Screen>(); updateIntrinsicsRendering(); if (distort) { initDistortMap(); } automaticMode(); }
public PGraphicsOpenGL getGraphics() { if(this.isDrawingOnDisplay){ return (PGraphicsOpenGL) parent.getGraphics(); } if (thisGraphics == null) { thisGraphics = (PGraphicsOpenGL) parent.createGraphics( this.getRenderingSizeX(), this.getRenderingSizeY(), PApplet.P3D); } return thisGraphics; }
PGraphics rec = createGraphics(width, height, renderer, filename); g.beginRaw(rec); return rec;