beginRecord()

本参考资料用于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.

名称

beginRecord()

示例
 import processing.pdf.*;



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


beginRecord(PDF, "everything.pdf");


  } 
void draw()
{  
ellipse(mouseX, mouseY, 10, 10);


  } 
void mousePressed()
{  
endRecord();


exit();


  }  
描述 Opens a new file and all subsequent drawing functions are echoed to this file as well as the display window. The beginRecord() function requires two parameters, the first is the renderer and the second is the file name. This function is always used with endRecord() to stop the recording process and close the file.

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.

beginRecord() works only with the PDF and SVG renderers.

语法
beginRecord(renderer, filename)
参数
renderer String: PDF or SVG
filename String: filename for output
返回值 PGraphics or void
相关 endRecord()

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

beginRecord()