Created
June 7, 2013 06:50
-
-
Save theycallmeswift/5727477 to your computer and use it in GitHub Desktop.
Convert PNG Base64 data to images
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 createImage(data,cb) { | |
var img = new Image(); | |
img.src = "data:image/png;base64," + data; | |
img.onload = function() { | |
cb(img); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment