shixb commented on issue #517:
URL: 
https://github.com/apache/cordova-plugin-camera/issues/517#issuecomment-1529601008

   > 
   
   
   
   > 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.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to