【发布时间】:2021-02-25 18:34:00
【问题描述】:
【问题讨论】:
-
欢迎堆栈溢出。查看 fabricjs.com/interaction-with-objects-outside-canvas 了解如何将 dom 对象覆盖在 Fabric 对象上,查看 fabricjs.com/events 了解如何使用事件(缩放事件可以更新叠加层的文本)
标签: javascript fabricjs
【问题讨论】:
标签: javascript fabricjs
我们可以使用下面的代码来获取选定或活动的图像大小
// for getting active objects, here its Rectangle
this.selectedObj= this.canvas.getActiveObject().toObject().objects;
// if there is one object we get the resultant values like this.
var width = this.selectedData.objects[0].width;
var height = this.selectedData.objects[0].height;
【讨论】: