Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add Image to Canvas
window.onload = function ()
var canvas = document.getElementById("overlay_canvas");
var ctx = canvas.getContext("2d");
var image = new Image();
image.src = "";
image.onload = function () {
ctx.drawImage(image, 0, 0);
image_ctx = image.getContext("2d");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.