Skip to content

Instantly share code, notes, and snippets.

@Swolebrain
Created February 23, 2015 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Swolebrain/835ce55b7fdae34b1767 to your computer and use it in GitHub Desktop.
Save Swolebrain/835ce55b7fdae34b1767 to your computer and use it in GitHub Desktop.
function greenLines(){
var imgdata = ctx.getImageData(0,0,600,600);
for (var i =0; i < imgdata.data.length; i+=40){ //move forward 40 spots because each
//pixel is 4 array spots and we wanna move 10 pixels
imgdata.data[i] = 0;
imgdata.data[i+1]=255;
imgdata.data[i+2]=0;
imgdata.data[i+3] = 255;
}
ctx.putImageData(imgdata, 0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment