📜  下载 canvas js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:26.656000             🧑  作者: Mango

代码示例1
function download() {
var download = document.getElementById("download");
var image = document.getElementById("myCanvas").toDataURL("image/png")
    .replace("image/png", "image/octet-stream");
download.setAttribute("href", image);
//download.setAttribute("download","archive.png");
}