Created
August 21, 2016 06:52
-
-
Save nasitra/0e3cc736c785f77b6a206b3334845413 to your computer and use it in GitHub Desktop.
Save canvas as an image file
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
var canvas = document.getElementById('canvas'); | |
var image = canvas.toDataURL('image/png').replace('image/png', 'image/octet-stream'); | |
window.location.href = image; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment