Answers for "clear canvas for redrawing"

1

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);
Posted by: Guest on September-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language