Skip to content

Instantly share code, notes, and snippets.

@shamique
Created October 25, 2018 16:10
Show Gist options
  • Save shamique/034771a6184546b5190dc43ca5bec4cd to your computer and use it in GitHub Desktop.
Save shamique/034771a6184546b5190dc43ca5bec4cd to your computer and use it in GitHub Desktop.
openCamera() {
this.platform.ready().then(readySource => {
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
};
this.camera.getPicture(options).then(
imageData => {
this.imageView = "data:image/jpeg;base64," + imageData;
this.imageData = imageData;
},
err => {
alert("Error in capture image");
}
);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment