Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
grabPicture() {
const options: CameraOptions = {
quality: 100,
targetHeight: 200,
targetWidth: 200,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
this.loading = this.loadingCtrl.create({
content: 'Please wait...'
});
this.loading.present();
this.selectedPhoto = this.dataURItoBlob('data:image/jpeg;base64,' + imageData);
this.upload();
}, (err) => {
console.log('error', err);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment