Reputation: 203
I want to fill image data with white background. How can I add white background data with image data.
I'm using the following scenario:-
var imageData = shapesContext.getImageData(x,y,width,height);
context.putImageData(imageData,x,y);
Upvotes: 0
Views: 799
Reputation: 277
If you are using only a single color, what about using fillRect instead?
context.fillStyle="white";
context.fillRect(0,0,canvas.width,canvas.height);
~Cheers
Upvotes: 2