-
What an amazing tool you have made! Effortless, easy to use and beautiful! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @matriim Try this: In your html code, include a button you will use to take the screenshot and download the image <div id="download">Download Image</div> and in your javascript code create a function to manage the download whenever the button is clicked. var downloadButton = document.getElementById("download");
function download() {
let canvas = document.getElementById('your-canvas-id'); // replace 'your-canvas-id' with the id of your canvas
let screenshot = canvas.toDataURL("image/png");
let a = document.createElement('a');
a.href = screenshot;
a.download = 'screenshot.png';
a.click();
}
downloadButton.addEventListener("click", download); This will do the trick. In this sandbox I tested. cheers |
Beta Was this translation helpful? Give feedback.
-
@Javingka Thanks for posting an answer, that should do the job! @matriim And if you're using the Cosmograph App on our website, you can press |
Beta Was this translation helpful? Give feedback.
Hi @matriim
Try this:
In your html code, include a button you will use to take the screenshot and download the image
and in your javascript code create a function to manage the download whenever the button is clicked.
This will do the …