관리 메뉴

레트로필름 IT Blog

canvas clearrect not working 본문

Front/CSS

canvas clearrect not working

레트로필름 - 사진필터앱 레트로필름 2020. 9. 14. 08:05

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
}
cs

 

 
0 Comments
댓글쓰기 폼