1
ギャラリーから画像を選択してトリミングし、クロップされた画像をファイルとしてギャラリーに保存します。 トリミング画像をギャラリーに保存
iは、カメラのネイティブを使用しますが、私はあなた自身がcordova-plugin-file
を使用してファイルを保存する必要があり
const options: CameraOptions = {
quality: 100,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
//allowEdit: true
}
this.camera.getPicture(options).then((imageData) => {
this.base64Image = "data:image/JPEG;base64,"+imageData;
//this.path =this.base64Image.toDataURL;
console.log("path ",this.base64Image);
//resolve(this.base64Image);
}, (err) => {
console.log("error",err)
});