我是Html 5 canvas的新手,有没有一种方法可以从模拟了滚动条的整个画布中保存图像?
带有滚动条的示例画布: https://konvajs.org/downloads/code/sandbox/Canvas_Scrolling_Transform.html
保存图像
var canvas = document.getElementsByTagName('canvas')[0];
var MIME_TYPE = "image/png";
var imgURL = canvas.toDataURL(MIME_TYPE);
var dlLink = document.createElement('a');
dlLink.download = 'dl';
dlLink.href = imgURL;
dlLink.dataset.downloadurl = [MIME_TYPE, dlLink.download, dlLink.href].join(':');
document.body.appendChild(dlLink);
dlLink.click();