jsyg-cropandresize
v1.0.0
Published
Crop and resize images with JSYG framework
Downloads
763
Maintainers
Readme
JSYG.CropAndResize
Crop and resize image with JSYG framework
Demo
http://yannickbochatay.github.io/JSYG.CropAndResize/
Installation
npm install jsyg-cropandresize
Example 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);
});
});