以下方法包含将64位字符串保存到图像文件的功能
pictureDir=this.file.dataDirectory+'pictures/'; //image directory
public saveImage(base64:string, name:string):Promise<string>{
return new Promise((resolve, reject)=>{
this.file.writeFile(this.pictureDir, name, base64, )
.then((data)=>{
resolve(this.pictureDir+name);
})
.catch((err)=>{
alert(err.message)
reject(err);
})
})
}