Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

clear canvas for redrawing

//Given that canvas is a canvas element or an OffscreenCanvas object,

const context = canvas.getContext('2d');

context.clearRect(0, 0, canvas.width, canvas.height);
 
PREVIOUS NEXT
Tagged: #clear #canvas #redrawing
ADD COMMENT
Topic
Name
2+7 =