1.0.0 • Published 8 years ago
jsyg-cropandresize v1.0.0
JSYG.CropAndResize
Crop and resize image with JSYG framework
Demo
http://yannickbochatay.github.io/JSYG.CropAndResize/
Installation
npm install jsyg-cropandresizeExample with module bundler
<link rel="stylesheet" href="node_modules/jsyg-editor/JSYG.Editor.css"/>
<svg width="620" height="620" id="content">
    <image xlink:href="image.jpg" width="620" height="620"/>
</svg>import CropAndResize from "jsyg-cropandresize"
let crop = new CropAndResize("#myImage");
            
crop.enable();
            
document.querySelector('#myButton').addEventListener("dblclick",function() {
    crop.toCanvas().then(function(canvas) {
        document.body.appendChild(canvas);
    });
});