Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to download canvas.toDataURL image to disk
var link = document.createElement('a');
link.href = Main.backbuffer.g2canvas.canvas.canvas.toDataURL();
link.download = 'coolimage.jpg';
document.body.appendChild(link);
link.click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.