// following code create an instance of imagecroppervarcropper=ImageCropper.init({el: 'avatar',// the canvas element's idwidth: 300,// the width of canvasheight: 300,// the height of canvasmode: ImageCropper.MODE_DEVELOP,// MODE_DEVELOP or MODE_PRODUCT, default MODE_PRODUCTonread: function(){},// the function you want to call when loading file finishonload: function(){},// the function called when loading image finishonscale: function(){},// the function called when image is scaledonmoveTo: function(){},// onmoveBy: function(){},onrotate: function(){}});// now you can do whatever you want on itcropper.loadFile(file);// read from filecropper.loadDataURL(base64Str);// read dataURLcropper.rotate(cropper.ROTATE_COUNTERCLOCKWISE);// rotationcropper.rotate(cropper.ROTATE_CLOCKWISE);// rotationcropper.scale(1.5,1.5);// scale to 1.5xcropper.moveTo(10,20);// move to point(10, 20) of the origin imagecropper.moveBy(30,10);// move to point(x + 30, y + 10) of the origin imagevardataURL=cropper.getDataURL();// get the dataURL of the image in canvas