如何使用Fabric JS在画布内左右倾斜布料图像? 我需要它按照显示器的显示方式,所以我可以像它一样粘贴它 正在屏幕上显示
答案 0 :(得分:0)
var canvas = new fabric.Canvas('canvas');
fabric.Image.fromURL("https://www.google.co.in/images/srpr/logo11w.png", function(img) {
img.set({transformMatrix: [1, .30, 0, 1, 0, 0],width:200,height:50,top:100,left:150});
img.setCoords();
canvas.add(img);
canvas.renderAll();
})

body {
background-color: ivory;
padding:30px;
}
canvas {
border: 1px solid red;
}

<h3>FabricJS: using transformMatrix to skew-Y</h3>
<canvas id="canvas" width="300" height="300"></canvas>
&#13;