html2canvas(document.getElementById("poster-canvas-box"), {
useCORS: true,
height: document.getElementById("poster-canvas-box").clientHeight - 2,
// canvas高度与所截图高度相同或者更小,解决底部白边问题
width: document.getElementById("poster-canvas-box").clientWidth - 2}).then((canvasElement) => {
// do something
})
canvas高度与所截图高度相同或者更小,解决底部白边问题
最新推荐文章于 2022-04-08 15:37:52 发布