The saveCanvas() function is used to save a p5.Table object to a file. The format of the file saved can be defined as a parameter to the function. It saves a text file with comma-separated-values by default, however, it can be used to save it using-tab separated-values or generate an HTML table from it.
saveCanvas(selectedCanvas, filename, extension)
Parameters: This function accepts three parameter as mentioned above and described below.
- selectedCanvas: This is a p5.Table object that would be saved to the file.
- filename: It specifies the string that is used as the filename of the saved file. It is an optional parameter.
- extension: It is a string which denotes the extension of the file to be saved. It is an optional parameter.
Below example illustrates the saveCanvas() function in p5.js:
Online editor: https://editor.p5js.org/
- How to get the function name inside a function in PHP ?
- PHP | abs() Function
- p5.js | hex() function
- PHP | sin( ) Function
- PHP | dir() Function
- PHP | cos( ) Function
- D3.js | d3.map.set() Function
- PHP | Ds\Set contains() Function
- p5.js | tan() function
- PHP | ord() Function
- p5.js | mag() Function
- D3.js | d3.max() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.