var copyDom = document.querySelector('.fenxiang1'); var width = copyDom.offsetWidth;//dom宽 var height = copyDom.offsetHeight;//dom高 console.log(JSON.stringify(copyDom)); console.log(width); console.log(height); var scale = 2;//放大倍数 html2canvas(copyDo
1.加载显示图片 <canvas id="canvasOne" class="myCanvas" width="500" height="500"></canvas> <script> var canvas = document.getElementById('canvasOne'); var ctx = canvas.getContext('2d'); //加载图片 var img = n