Answers for "jquery clear canvas"

16

Javascript clear canvas

var canvas = document.getElementById("myCanvasID");
var context = canvas.getContext('2d');
context.clearRect(0, 0, canvas.width, canvas.height); //clear html5 canvas
Posted by: Guest on July-25-2019
-2

resetting canvas html

var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
context.clearRect(0, 0, canvas.width, canvas.height);
Posted by: Guest on May-19-2020
0

clear canvas content jquery

//set a const for all the code 
const context = canvas.getContext('2d');

//to clear the canvas use:
context.clearRect(0, 0, canvas.width, canvas.height);

//if the canvas is with 300 and height 450:
context.clearRect(0, 0, 300, 450);
Posted by: Guest on November-15-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language