[英]new image in canvas with fabric js doesn't work for chrome
I use fabric.js to manage my canvas, however when I make new fabric.Image after dropped a picture in my canvas it's doesn't work in chrome! 我使用fabric.js来管理画布,但是当我制作新的fabric.Image在画布中放了图片后,它在chrome中不起作用!
there is my code : 有我的代码:
var imgElement = document.getElementById(idImageToDrage);
var imgInstance = new fabric.Image(imgElement, {
id: parseInt(idImageToDrage),
left: calculPositionLeft, // position when I drop the picture
top: calculPositionTop,
scaleX: 0.147,
scaleY: 0.147,
angle: 0,
zindex: $('#containerInnerImgToDrag').children().length,
name: 'img'
});
imgInstance.setControlsVisibility({ 'bl': false, 'br': false, 'mb': false, 'ml': false, 'mr': false, 'mt': false, 'tl': false, 'tr': false });
canvas.add(imgInstance);
This code work for Firefox, what can I do ? 此代码适用于Firefox,该怎么办?
Thanks! 谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.