Set Quality of Png with html2canvas

后端 未结 3 1222
生来不讨喜
生来不讨喜 2020-12-18 15:14
        html2canvas($(\"#Element\"), {
  onrendered: function(canvasq) {
    var w=window.open();
    w.document.write(\"

\"+Re

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-18 15:27

    you can use scale options in html2canvas.

    In the latest release, v1.0.0-alpha.1, you can use the scale option to increase the resolution (scale: 2 will double the resolution from the default 96dpi).

    // Create a canvas with double-resolution.
    html2canvas(element, {
        scale: 2,
        onrendered: myRenderFunction
    });
    

提交回复
热议问题