2017-12-14 15 views
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) 
    }); 

答えて

関連する問題