Skip to content

Instantly share code, notes, and snippets.

@Joncom
Created March 3, 2019 08:23
Show Gist options
  • Save Joncom/bc7170c0767550eeeebcb77a97c0b362 to your computer and use it in GitHub Desktop.
Save Joncom/bc7170c0767550eeeebcb77a97c0b362 to your computer and use it in GitHub Desktop.
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