update
This commit is contained in:
parent
4fcb1ef49e
commit
0ee7b8742d
@ -24,15 +24,13 @@ console.log(canvas2.style.width)
|
|||||||
x:0,
|
x:0,
|
||||||
y:0
|
y:0
|
||||||
}).then(canvas => {
|
}).then(canvas => {
|
||||||
//canvas就是绘制完成的画板
|
//canvas就是绘制完成的画板对象
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
html2canvas参数参考官网 重点介绍canvas那一部分
|
html2canvas
|
||||||
context.scale(x 倍数, y 倍数); //画板放大指定倍数
|
context.scale(x 倍数, y 倍数); //画板放大指定倍数
|
||||||
***
|
|
||||||
重点
|
|
||||||
canvas2.width = w * times * window.devicePixelRatio; //指定画板宽度
|
canvas2.width = w * times * window.devicePixelRatio; //指定画板宽度
|
||||||
canvas2.height = h * times * window.devicePixelRatio; //指定画板宽度
|
canvas2.height = h * times * window.devicePixelRatio; //指定画板宽度
|
||||||
为什么要再乘以window.devicePixelRatio
|
为什么要再乘以window.devicePixelRatio
|
||||||
|
Loading…
Reference in New Issue
Block a user