1
window.onload = function() {
var Can1 = document.getElementById('canvas2');
var ctx = Can1.getContext("2d");
Can1.width=960;
Can1.height=720;
//ctx.fillStyle = "rgba(0,255,0,0)";
//ctx.fillRect(0,0,960,720);
var imgData=ctx.getImageData(0,0,960,720);
for (var i=0;i<imgData.data.length;i+=4)
{
imgData.data[i]=255/*-imgData.data[i]*/;
imgData.data[i+1]=0/*255-imgData.data[i+1]*/;
imgData.data[i+2]=0/*255-imgData.data[i+2]*/;
imgData.data[i+3]=255-imgData.data[i+3];
}
ctx.putImageData(imgData,0,0);
}
我希望畫布以紅色着色,但不影響阿爾法值。 – 2013-02-13 06:13:33
它在Android瀏覽器中的錯誤 – 2014-02-13 10:07:13