Created
November 13, 2021 13:48
-
-
Save manthrax/ac96ac0a41ddd012204d0181bbbded81 to your computer and use it in GitHub Desktop.
Take a screenshot of canvas and download as jpg
This file contains hidden or 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
let takeScreenShot=()=>{ | |
let d=document; | |
let e = d.createElement("a"); | |
e.setAttribute("href", renderer.domElement.toDataURL("image/jpeg")); | |
e.setAttribute("download", "Screenshot.jpeg"); | |
e.style.display = "none"; | |
d.body.appendChild(e); | |
d.click(); | |
d.body.removeChild(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment