Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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
langjavascript
myCropper.activateKeyboardAccessibility();

To confirm the crop action, call the following method: 

Code Block
langjavascript
var croppingReturnValues = myCropper.reset();
var croppedImageDataURL = croppingReturnValues[0];
var croppingDimensions = croppingReturnValues[1];

To cancel the crop action without actually cropping the image:

Code Block
langjavascript
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

...