vendredi 17 avril 2015

How to clear canvas html5?

I'm trying to clear a Canvas.


I execute a setInterval function, who calls different "canvas" in any iteration.


After any execution, i call this function:



function deleteCanvas(){
var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");
context.clearRect(0, 0, context.width,context.height);
context.beginPath();
}


But no delete the canvas image.


Any idea?


Best regards,


Aucun commentaire:

Enregistrer un commentaire