This topic describes the JavaScript API of WVImage. You can refer to this topic when you create HTML5 apps or MiniApps. You can use the JavaScript API of WVImage to save images to albums.
WVImage.saveImage
Allows you to save images from HTTP or HTTPS URLs or Base64-encoded images to albums.
Sample code:
var params = {
// The URL of the image to be saved.
url: 'https://gw.xxx.com/xxx/xxx.png',
};
window.WindVane.call('WVImage', 'saveImage', params, function(){
alert('saveImage success');
}, function(e){
alert('saveImage failure: ' + JSON.stringify(e));
});Input parameters:
[string]url: the URL of the image to be saved.
Callback parameters:
If the image is saved, the success callback is invoked. Otherwise, the failure callback is invoked.
Parameters for the failure callback:
[string]msg: the cause of the failure.