Last active
August 29, 2015 14:01
-
-
Save dniswhite/6dfe0e2f9ce6391d1ce8 to your computer and use it in GitHub Desktop.
convert html5 canvas to base64String
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 convertImgToBase64(id, outputFormat){ | |
var canvas = document.createElement(id); | |
var imageDataURL = canvas.toDataURL(outputFormat || 'image/png'); | |
return imageDataURL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment