Last active
August 29, 2015 14:01
-
-
Save dniswhite/353f8c7f673728637639 to your computer and use it in GitHub Desktop.
load base64 into canvas element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertBase64toImage(id, image64) { | |
var canvas = document.createElement(id); | |
var context = canvas..getContext('2d'); | |
var baseImage = new Image(); | |
baseImage.onload() = function() { | |
context.drawImage(baseImage, 0, 0); | |
}; | |
baseImage.src = image64; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment