我想在fabric.js中绘制一个图像,其高度等于画布高度和宽度等于画布宽度。我希望我的画布应该响应。这可能吗??
$(document).ready(function () {
var canvas = new fabric.Canvas('c');
var can = document.getElementById('c');
$('.js_img_feed').click(function (hello) {
var hello1 = hello.currentTarget;
fabric.Image.fromURL(hello1.src, function(img) {
canvas.add(img.set({ left: 0, top:0 ,width:can.width, height:can.height}))
})
})
})