使用sketch.js继续编辑草图图像 [英] Continue edit sketching image using sketch.js

查看:159
本文介绍了使用sketch.js继续编辑草图图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是sketch.js中的示例( http://intridea.github.io/sketch。 js / )绘制草图并能够将其作为图像文件保存在目录中。

I am using example from sketch.js(http://intridea.github.io/sketch.js/) to draw sketching and able to save it in directory as an image file.

问题是如何在我能够渲染后继续编辑草图图像?

The problem is how to continue editing the sketching image after I able to render it?

任何建议或感谢解决方案。

Any suggestion or solution is appreciated.

谢谢

推荐答案

//declare an array
var canvas;

$('#buttonSave').click(function () {
   //saves all actions you made in your canvas
   canvas = $('#canvasId').sketch().actions 
});

$('#buttonRetrieve').click(function () {
    //iterates through your array, adds and redraws each action
    $.each(canvas, function (i, val) {
        $('#canvasId').sketch().actions.push(val);
        $('#canvasId').sketch().redraw();
        });
});

这篇关于使用sketch.js继续编辑草图图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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