📜  如何以命名的方式在画布 javascript 中下载图像 - Javascript 代码示例

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

代码示例1
var canvas = document.getElementById("mcanvas");
  image = canvas.toDataURL("image/png", 1.0).replace("image/png", "image/octet-stream");
  var link = document.createElement('a');
  link.download = "my-image.png";
  link.href = image;
  link.click();