Widget Instances

Creating a widget

const widget = Jcrop.Widget.create();

Add widget to stage

const jcrop = Jcrop.attach('target');
const widget = Jcrop.Widget.create();
jcrop.addWidget(widget);

Create from the stage

Add a new cropping widget using a Rect object. Rect objects define a rectangular region.


 

const rect = Jcrop.Rect.fromPoints([100,100],[200,200]);
jcrop.newCropper(rect,{ aspectRatio: rect.aspect });