Html2Canvas 无法正确渲染图像
Html2Canvas not rendering image properly
这是我的代码,我没有得到正确的图像,特别是在 Crome 中。
function capture(){
html2canvas(document.querySelector(".pc_table"), {
logging: true,
letterRendering: 1,
allowTaint: true,
useCORS: true
}).then(canvas => {
console.log(canvas.toDataURL("image/jpeg", 0.9));
})
}
有时图像渲染正确(URL:https://www.gadgetlnn.com.bd/index.php?route=product/pcbuilder)点击捕获,但大多数图像就像
我尝试了很多事情,例如:
https://github.com/niklasvh/html2canvas/issues/722
但没有任何效果。任何帮助将不胜感激。
这是因为图像损坏。
我只是为了正确加载图像。结果成功了。
这是我的代码,我没有得到正确的图像,特别是在 Crome 中。
function capture(){
html2canvas(document.querySelector(".pc_table"), {
logging: true,
letterRendering: 1,
allowTaint: true,
useCORS: true
}).then(canvas => {
console.log(canvas.toDataURL("image/jpeg", 0.9));
})
}
有时图像渲染正确(URL:https://www.gadgetlnn.com.bd/index.php?route=product/pcbuilder)点击捕获,但大多数图像就像
这是因为图像损坏。 我只是为了正确加载图像。结果成功了。