Canvas fillStyle none in HTML5 -


i want fill no color canvas i.e. want background div color should keep on displaying in div. have googled didn't find solution keep fillstyle no color.

also tried omitting fillstyle leave me black color.

any options available?

thanks

you need use clear canvas:

context.clearrect(0, 0, canvas.width, canvas.height); 

(or rectangle need).

also make sure have no css rules set canvas element's background (which might case if canvas not transparent on init canvas transparent default).

if need clear non-regular shape can use composite mode:

context.globalcompositeoperation = 'destination-out'; 

(xor , source-out can used degree remove existing pixels variations).

this clear canvas in form of next shape (path) draw (or use image solid pixels clear canvas).


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -