Skip to content

Instantly share code, notes, and snippets.

@shameerc
Created October 1, 2011 09:49
Show Gist options
  • Save shameerc/1255818 to your computer and use it in GitHub Desktop.
Save shameerc/1255818 to your computer and use it in GitHub Desktop.
// get the canvas from options passed to costructor
canvas = $(options.canvas)[0];
// check if the browser supports canvas and
// get the contect
if(canvas.getContext('2d')){
ctx = canvas.getContext('2d');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment