Skip to content

Instantly share code, notes, and snippets.

@whistler
Created October 17, 2014 16:33
Show Gist options
  • Save whistler/79ebc3e1ed42b326ac97 to your computer and use it in GitHub Desktop.
Save whistler/79ebc3e1ed42b326ac97 to your computer and use it in GitHub Desktop.
Add Image to Canvas
window.onload = function ()
{
var canvas = document.getElementById("overlay_canvas");
var ctx = canvas.getContext("2d");
var image = new Image();
image.src = "http://placekitten.com/4536/3024";
image.onload = function () {
ctx.drawImage(image, 0, 0);
image_ctx = image.getContext("2d");
debugger;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment