gpt4 book ai didi

javascript - 如何使用fabricjs增加从canvas下载的图像的大小?

转载 作者:行者123 更新时间:2023-11-30 20:59:32 25 4
gpt4 key购买 nike

我正在使用以下内容下载我的fabricjs Canvas ,它效果很好,但我想知道如何才能使下载的图像更大,以便在打印时更清晰?感谢您提前提供的任何帮助。

// Download as png
function download(url, name) {
// make the link. set the href and download. emulate dom click
$('<a>').attr({
href: url,
download: name
})[0].click();
}

function downloadFabric(canvas, name) {
// convert the canvas to a data url and download it.
download(canvas.toDataURL(), name + '.png');
}

<button onclick="downloadFabric(canvas,'save');">Save</button>

最佳答案

这最终类似于 this post 。从那里我能够将 {multiplier: 4} 添加到 canvas.toDataURL(); 效果非常好。

关于javascript - 如何使用fabricjs增加从canvas下载的图像的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47268159/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com