remove()

Removes the graphics buffer from the web page.

Calling myGraphics.remove() removes the graphics buffer's <canvas></canvas> element from the web page. The graphics buffer also uses a bit of memory on the CPU that can be freed like so:

// Remove the graphics buffer from the web page.
myGraphics.remove();

// Delete the graphics buffer from CPU memory.
myGraphics = undefined;

Note: All variables that reference the graphics buffer must be assigned the value undefined to delete the graphics buffer from CPU memory. If any variable still refers to the graphics buffer, then it won't be garbage collected.

उदाहरण

This page is generated from the comments in src/core/p5.Graphics.js . Please feel free to edit it and submit a pull request!

संबंधित संदर्भ