[英]How to add background image data in HTML5 canvas
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);
If you are using only a single color, what about using fillRect instead? 如果您只使用一种颜色,那么使用fillRect呢?
context.fillStyle="white";
context.fillRect(0,0,canvas.width,canvas.height);
~Cheers 〜干杯
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.