문제

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.

Thanks

도움이 되었습니까?

해결책

//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();
        });
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top