VintaSoft Twain .NET SDK 15.1: Documentation for Web developer
Vintasoft.Twain Namespace / WebAcquiredImageJS type / getAsBase64StringAsync Property
Syntax Exceptions Remarks BrowserCompatibility SeeAlso
In This Topic
    getAsBase64StringAsync Method
    In This Topic
    Sends an asynchronous request to get an image as a base64-string.
    Syntax
    var instance = new Vintasoft.Twain.WebAcquiredImageJS(twainDeviceManager, imageId, imageInfo);
    
    var value; // Type: string
    
    // Parameters
    var successFunc; // Type: function
    var errorFunc; // Type: function
    
    value = instance.getAsBase64StringAsync(successFunc, errorFunc);
    
    
    function getAsBase64StringAsync(
    successFunc
    A function that will be executed if request is executed successfully. Function prototype: "successFunc(image, imageAsBase64String)", where 'image' parameter is an instance of WebAcquiredImageJS class, 'imageAsBase64String' parameter is base64-string.
    : Function,
    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.
    : Function
    ) : string;

    Parameters

    successFunc
    A function that will be executed if request is executed successfully. Function prototype: "successFunc(image, imageAsBase64String)", where 'image' parameter is an instance of WebAcquiredImageJS class, 'imageAsBase64String' parameter is base64-string.
    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.

    Return Value

    A base64-string.
    Exceptions
    ExceptionDescription
    Thrown if image bitmap is not retrieved.
    Remarks

    This function sends an asynchronous request to get image as a base64-string. If you want to use synchronous request instead of asynchronous request, please use WebAcquiredImageJS.getAsBase64String function.

    Browser Compatibility
    9
    See Also