【发布时间】:2016-05-14 01:54:50
【问题描述】:
图像是使用 HTML2CANVAS 从 DIV 中捕获的,但图像质量很差,而且像素化。拍摄的图像分辨率为96 dpi,如何提高分辨率?
有没有什么办法可以得到高质量的高分辨率图像,请帮帮我。
我的代码:
<div style="border-style: solid; height: 15cm; width: 15cm; border-radius:25px;
position: relative; top: 1px;" id="DIV1">
var element = $("#DIV1");
html2canvas(element, {
useCORS: true,
onrendered: function (canvas) {
var dataURL = canvas.toDataURL("image/png");
window.open(dataURL);
}
});
我使用 FileUploader 将图像放在 DIV1 上方,这是一个高分辨率图像,但是当 html2canvas 捕获图像时,图像像素和分辨率将为 96dpi。如何将分辨率提高到 300 dpi?
【问题讨论】:
标签: javascript asp.net canvas html2canvas