I have made ships with HTML5 and JS but I want to save the results in PNG format, how do I do . . . Traducido de español a inglés por traductor de Google si consigues un error por favor reportelo.
10/11/2020 12:54:28 AM
Daniel Briceño10 Answers
New AnswerYou will have to open canvas image in your browser. I meant that you have to open your HTML in your browser. Then you will have to right click on your drawing. And click on save image. This will download the image. After saving THIS if u want to get in any other format. You can convert that photo. Hope this helpsππ
This solution allows you to change the name of the downloaded file: HTML: <a id="link"></a> JAVASCRIPT: var link = document.getElementById('link'); link.setAttribute('download', 'MintyPaper.png'); link.setAttribute('href', canvas.toDataURL("image/png").replace("image/png", "image/octet-stream")); link.click();
and I want to know how to save the image but your answer does not help me. Because I use a mobile device and the event: onmousemove () doesn't allow me that option. And he has another idea.
I can use the onclick event and on the cell phone it would give me the same results but not on the pc. Well, on the pc it would have very different results
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message