Created
October 6, 2014 07:28
-
-
Save Kreijstal/1ca05511126c04312e8a to your computer and use it in GitHub Desktop.
gets base64 uri of image
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 getDrawURL(){ | |
var img=document.createElement('img'),canvas=document.createElement('canvas'),context=canvas.getContext('2d'); | |
img.src='http://fc05.deviantart.net/fs70/i/2013/357/c/8/my_teenage_pony_by_kilala97-d6z4jke.jpg'; | |
canvas.height=img.height; | |
canvas.width=img.width; | |
context.drawImage(img,0,0) | |
return canvas.toDataURL('image/png'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment