I want to know the best option to download an edited image on my computer, kind of the website straightouttasomewhere.com I created the button already which is easy to create, but I want that button make it work.
<button id="dlbtn" onclick="saveAsLocalImg()">Download</button>
then, this is the javascript function I want to use to make the download button work
function saveAsLocalImg(){
var cvs=document.getElementById("mycanvas");
var img=cvs.toDataURL("image/png").replace("image/png", "image/octet-stream");
window.location.href=img;
}
This javascript function work?
Btw, I am using notepad++ because of lacking of web design programs.
Any suggestions??? I will appreciate your help