In This Topic
Sends an asynchronous request to resize canvas of image.
Syntax
var instance = new Vintasoft.Twain.WebAcquiredImageJS(twainDeviceManager, imageId, imageInfo);
var value; // Type: any
// Parameters
var canvasWidth; // Type: number
var canvasHeight; // Type: number
var canvasColor; // Type: number
var imageXPosition; // Type: number
var imageYPosition; // Type: number
var successFunc; // Type: function
var errorFunc; // Type: function
value = instance.resizeCanvasAsync(canvasWidth, canvasHeight, canvasColor, imageXPosition, imageYPosition, successFunc, errorFunc);
function resizeCanvasAsync(
: number,
: number,
: number,
: number,
: number,
: Function,
: Function
) : any;
Parameters
- canvasWidth
- Width, in pixels, of the image canvas.
- canvasHeight
- Height, in pixels, of the image canvas.
- canvasColor
- Color of the image canvas. Possible values: 0-AutoDetect, 1-Black, 2-White.
- imageXPosition
- X position, in pixels, of the original image within new image.
- imageYPosition
- Y position, in pixels, of the original image within new image.
- 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 resize canvas of image. If you want to use synchronous request instead of asynchronous request, please use WebAcquiredImageJS.resizeCanvas function.
Browser Compatibility
See Also