LoadImageFromBase64Binary()

Description

Load image(s) from a base64 string.

Syntax

.LoadImageFromBase64Binary(imageData, imageType, [optionalAsyncSuccessFunc, optionalAsyncFailureFunc]);

Parameters

<string> imageData: specifies the base64 string.
EnumDWT_ImageType (int) imageType: specifies the format.

 

Type Numeric Value
IT_BMP 0
IT_JPG 1
IT_TIF 2
IT_PNG 3
IT_PDF 4

<OnSuccess function> optional optionalAsyncSuccessFunc: callback function triggered when the operation succeeds.
<OnFailure function> optional optionalAsyncFailureFunc: callback function triggered when the operation fails.
If the callback functions exist, the function becomes asynchronous. Otherwise, it's synchronous.

Return value

bool

true indicates success. false indicates failure.

When false is returned, check ErrorCode or ErrorString for error information.

See also

GetSelectedImagesSize
SetSelectedImageIndex

Example

var imagedata;
DWObject.SelectedImagesCount = 1;
DWObject.SetSelectedImageIndex(0,0);
DWObject.GetSelectedImagesSize(EnumDWT_ImageType.IT_JPG);
imagedata = DWObject.SaveSelectedImagesToBase64Binary();
DWObject.LoadImageFromBase64Binary(imagedata, EnumDWT_ImageType.IT_JPG, function(){
    console.log('success');
    },function(){
    console.log('failure');
});