一、github地址:css
https://github.com/fabricjs/fabric.jshtml
二、簡述git
Fabric.js將canvas的編程變得簡單。同時在canvas上添加了交互。交互包括:移動、旋轉、縮放,修改透明度、顏色和z-index等。github
使用Fabric.js能夠建立ectangles, circles, ellipses, polygons,以及更復雜的圖形。編程
三、簡單示例canvas
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<canvas id="canvas" width="300" height="300"></canvas>
<script src="https://cdn.bootcss.com/fabric.js/3.4.0/fabric.min.js"></script>
<script>
var canvas = new fabric.Canvas('canvas'); var rect = new fabric.Rect({ top: 100, left: 100, width: 60, height: 70, fill: 'red' }); canvas.add(rect); </script>
</body>
</html>