fabric.js 学习
Posted 高中国流
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了fabric.js 学习相关的知识,希望对你有一定的参考价值。
官网地址:http://fabricjs.com/ git https://github.com/kangax/fabric.js/
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> canvas { border: 1px dashed black; } </style> <script src="fabric.min.js"></script> </head> <body> <canvas id="canvas" width="600" height="600"></canvas> <script> window.onload = function(){ var canvas = new fabric.Canvas(\'canvas\'); var rect = new fabric.Rect({ top : 50, left : 100, width : 100, height : 70, fill : \'red\' }); var circle = new fabric.Circle({ radius:50, fill:\'green\', left:200, top:200 }); var triangle = new fabric.Triangle({ width: 80, height: 100, fill: \'blue\', left: 50, top: 50 }); canvas.add(rect, circle, triangle); } </script> </body> </html>
以上是关于fabric.js 学习的主要内容,如果未能解决你的问题,请参考以下文章