Try this! 1 2 3 4 5 6 7 8 9 10 function canvasCleaner(){ var canvas = document.getElementById('myCanvas'); var ctx = canvas.getContext('2d', { alpha: false }); var img = document.getElementById("img"); //Canvas Clear //ctx.clearRect(0, 0, 3000, 3000); //not working :( ctx.canvas.width = ctx.canvas.width; //**canvas clear :) ctx.beginPath(); //canvas line clear } Colored by Color Scripter cs
canvas clearrect not working
Try this! 1 2 3 4 5 6 7 8 9 10 function canvasCleaner(){ var canvas = document.getElementById('myCanvas'); var ctx = canvas.getContext('2d', { alpha: false }); var img = document.getElementById("img"); //Canvas Clear //ctx.clearRect(0, 0, 3000, 3000); //not working :( ctx.canvas.width = ctx.canvas.width; //**canvas clear :) ctx.beginPath(); //canvas line clear } Colored by Color Scripter cs
2020.09.14