PGraphics

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

PGraphics

示例
 PGraphics pg;



void setup()
{  
size(100, 100);


pg = createGraphics(40, 40);


  } 
void draw()
{  
pg.beginDraw();


pg.background(100);


pg.stroke(255);


pg.line(20, 20, mouseX, mouseY);


pg.endDraw();


image(pg, 9, 30);


 image(pg, 51, 30);


  } 
描述 Main graphics and rendering context, as well as the base API implementation for processing “core”. Use this class if you need to draw into an off-screen graphics buffer. A PGraphics object can be constructed with the createGraphics() function. The beginDraw() and endDraw() methods (see above example) are necessary to set up the buffer and to finalize it. The fields and methods for this class are extensive. For a complete list, visit the developer’s reference.

To create a new graphics context, use the createGraphics() function. Do not use the syntax new PGraphics().

Methods
beginDraw() Sets the default properties for a PGraphics object
endDraw() Finalizes the rendering of a PGraphics object
Constructor
PGraphics() 
相关 createGraphics()

Updated on October 2, 2018 05:02:10pm EDT

PGraphics