views:

1777

answers:

3

Hi there,

After experimenting with composite operations and drawing images on the canvas I'm nog trying to remove images and compositing. How do I do this?

I need to clear the canvas for redrawing other images; this can go on for a while so I don't think drawing a new rectangle every time won't be the most efficient option.

Thanks!

+10  A: 
context.clearRect ( x , y , w , h );

or

canvas.width = canvas.width;
Pentium10
canvas.width = canvas.width; doesnt' seem to work on chrome, well I can't get it working at least!
bplus
+1  A: 

in webkit you need to set the width to a different value, then you can set it back to the initial value

John Allsopp