将画布保存到其所有对象并返回到画布的所有对象的图像,以编辑它们 [英] Save canvas to image with all its object and back to canvas with all objects back for editing them

查看:253
本文介绍了将画布保存到其所有对象并返回到画布的所有对象的图像,以编辑它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用面料JS在画布上添加对象,然后以图像的形式保存它。现在我想将图片恢复到画布中的编辑模式。

I am using fabrics JS for adding objects on canvas and then saving it in form of image. Now i want bring the image back to edit mode inside canvas.

您可以在 http://www.13thandmars.com/logo_studio/builder.html?project_id=17b36372c43c04044dd804454dfdf6e8

添加文本将在上面的链接中添加一个对象到tshirt。

Add text will add an object to tshirt in above link.

推荐答案

可以从JSON加载它

var myJson = JSON.stringify(canvas.toJSON(['left', 'top', 'lockMovementX', 'lockMovementY']));
canvas.loadFromJSON(myJson, function () {
    //render the canvas
    canvas.renderAll();
});

这篇关于将画布保存到其所有对象并返回到画布的所有对象的图像,以编辑它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆