js pix

  window.onload = function () {

            var img = new Image();
img.src = '1.gif';
var ctx = document.querySelector('#aa').getContext('2d'); img.onload = function () {
ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, 400, 400); var a = ctx.getImageData(0, 0, 100, 100), data = a.data; for (var i = 0, len = data.length; i < len; i += 4) {
data[i] = 0; //r
data[i + 1] = 0; //g
data[i + 2] = 0; //b
data[i+3]=255; //alpha } ctx.putImageData(a, 0, 0); } }

  

上一篇:项目Beta冲刺(团队4/7)


下一篇:项目Beta冲刺(团队5/7)