...
- canvas: The canvas object with which the cropper UI should associate.
- resizeFactor: The factor with which the image has been resized to fit in the canvas. e.g. if the original image width is 1000px and the canvas width is 500px, then the resize factor would be 2.
- image: The image to be drawn in canvas.
- imageX: The x coordinate for image to be drawn in canvas.
- imageY: The y coordinate for image to be drawn in canvas.
After the init method is called, the user can use the cropper to select the bounding box from the image. You can also activate the keyboard accessibility for cropper by calling the following method:
Code Block |
---|
|
myCropper.activateKeyboardAccessibility();
|
To confirm the crop action, call the following method:
Code Block |
---|
|
var croppingReturnValues = myCropper.reset();
var croppedImageDataURL = croppingReturnValues[0];
var croppingDimensions = croppingReturnValues[1]; |
To cancel the crop action without actually cropping the image:
Code Block |
---|
|
myCropper.reset(); |
...
Anchor |
---|
| Step 3: Add the script to your HTML |
---|
| Step 3: Add the script to your HTML |
---|
|
Step 3: Add the script to your HTML
...