my ts code
takePhoto()
{
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
// let base64Image = 'data:image/jpeg;base64,' + imageData;
this.myPhoto ='data:image/jpeg;base64,' +imageData;
console.log(this.myPhoto);
}, (err) => {
});
}
my html code
<ion-content padding>
<button ion-button (click)="takePhoto()" full color="primary">click</button>
<img src="{{myPhoto}}"/>
</ion-content>
111