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(
: Function,
: 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
| Exception | Description |
| 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
See Also