gpt4 book ai didi

canvas - fabricjs免费绘图,获取对象绘图的引用

转载 作者:行者123 更新时间:2023-12-04 13:32:51 25 4
gpt4 key购买 nike

在自由绘制模式下使用fabricjs时,您可以刷路径。在绘制路径之后,是否有办法立即将这些路径作为对象的引用?鼠标向上的示例获取对象:

canvas.on('mouse:up', function(options) {
var lastfreedraw = options.getLastFreeObject();
});

最佳答案

考虑到有关freedrawevents的信息,我建议您订阅path:created对象。就像是

canvas.on('path:created', function(e){
var your_path = e.path;
// ... do something with your path
});

应该做。

关于canvas - fabricjs免费绘图,获取对象绘图的引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17628422/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com