GuShiwei commented on issue #517: android 10 qusetion of CAMERA URL: https://github.com/apache/cordova-plugin-camera/issues/517#issuecomment-552748729 getPicture(type) { this.plt.ready().then(() => { // 照片配置设置 const options: CameraOptions = { // 图片质量 quality: 100, // 返回图片类型,DATA_URL:返回base64格式,FILE_URI:返回安卓的照片路径,NATIVE_URI:返回IOS的照片路径 destinationType: this.camera.DestinationType.FILE_URI, // 照片格式 encodingType: this.camera.EncodingType.JPEG, // 照片类型,PICTURE:照片,VIDEO:视频,ALLMEDIA:所有格式 mediaType: this.camera.MediaType.PICTURE }; this.camera.getPicture(options).then( imageData => { // imageData is either a base64 encoded string or a file URI // If it's base64 (DATA_URL): let base64Image = "data:image/jpeg;base64," + imageData; console.log(imageData); // 存放相册 this.photoLibrary.requestAuthorization().then(res => { this.photoLibrary .saveImage(imageData, "MIBS") .then(res => {}) .catch(error => { `alert(error);` }); }); }, err => { // Handle error // alert("照片拍摄错误") console.log(err); } ); }); } 我是这么写的,我的是ionic3工程
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
