VintaSoft Twain .NET SDK 15.0: Documentation for Web developer
Vintasoft.Twain Namespace / WebAcquiredImageJS type / crop Property
Syntax Exceptions Remarks BrowserCompatibility SeeAlso
In This Topic
    crop Method
    In This Topic
    Crops 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
    
    value = instance.crop(x, y, width, height);
    
    
    function crop(
    x
    X-coordinate, in pixels, of the upper-left corner of the crop rectangle.
    : number,
    y
    Y-coordinate, in pixels, of the upper-left corner of the crop rectangle.
    : number,
    width
    Width, in pixels, of the crop rectangle.
    : number,
    height
    Height, in pixels, of the crop rectangle.
    : number
    ) : 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.
    Exceptions
    ExceptionDescription
    Thrown if arguments have wrong type OR image is in processing now OR image processing is failed.
    Remarks

    This function sends a synchronous request to crop an image. If you want to use asynchronous request instead of synchronous request, please use WebAcquiredImageJS.cropAsync function.

    Browser Compatibility
    9
    See Also