0
我使用織物js和畫布從url添加圖像我想使畫布和包含圖像響應按分辨率。我們如何做到這一點? 我的代碼是: -如何使織物js中的畫布和圖像響應
<canvas id="panel" width="700" height="350"></canvas>
<script>
(function() {
var canvas = new fabric.Canvas('panel');
var rect;
fabric.Image.fromURL('abc.jpg', function (img) {
canvas.add(img.set({
width: canvas.width,
height:canvas.height,
originX :'left',
originY :'top',
selectable: false,
}));
});
})();
</script>