Skip to content

Instantly share code, notes, and snippets.

@akesling
Created May 14, 2012 02:06
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 akesling/2691303 to your computer and use it in GitHub Desktop.
Save akesling/2691303 to your computer and use it in GitHub Desktop.
var x = 0;
var y = 0;
var ds = 100;
var track = document.getElementById('track');
var viewport = document.getElementById('viewport').getContext('2d');
viewport.drawImage(track,x,y,ds,ds,0,0,500,500);
var pixels = viewport.getImageData();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment