📜  dom-to-image 质量差 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:56.042000             🧑  作者: Mango

代码示例1
const scale = 2;
const image = await toPng(elm, {
  height: elm.offsetHeight * scale,
  style: {
    transform: `scale(${scale}) translate(${elm.offsetWidth / 2 / scale}px, ${elm.offsetHeight / 2 / scale}px)`
  },
  width: elm.offsetWidth * scale
});