In This Topic
Sends an asynchronous request to crop an image.
Syntax
var instance = new Vintasoft.Twain.WebAcquiredImageJS(twainDeviceManager, imageId, imageInfo);
var value; // Type: any
// Parameters
var x; // Type: number
var y; // Type: number
var width; // Type: number
var height; // Type: number
var successFunc; // Type: function
var errorFunc; // Type: function
value = instance.cropAsync(x, y, width, height, successFunc, errorFunc);
function cropAsync(
: number,
: number,
: number,
: number,
: Function,
: Function
) : any;
Parameters
- x
- X-coordinate, in pixels, of the upper-left corner of the crop rectangle.
- y
- Y-coordinate, in pixels, of the upper-left corner of the crop rectangle.
- width
- Width, in pixels, of the crop rectangle.
- height
- Height, in pixels, of the crop rectangle.
- successFunc
- A function that will be executed if request is executed successfully. Function prototype: "successFunc(image)", where 'image' parameter is an instance of WebAcquiredImageJS class.
- errorFunc
- A function that will be executed if request is failed. Function prototype: "errorFunc(image, errorMessage)", where 'image' parameter is an instance of WebAcquiredImageJS class, 'errorMessage' parameter is string that describes error.
Exceptions
Exception | Description |
| Thrown if arguments have wrong type OR image is in processing now OR image processing is failed. |
Remarks
This function sends an asynchronous request to crop an image. If you want to use synchronous request instead of asynchronous request, please use WebAcquiredImageJS.crop function.
Browser Compatibility
See Also