Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- choose_picture()
- {
- let actionSheet = this.ActionSheetController.create({
- buttons: [
- {
- icon: 'camera',
- text: this.translate.instant('From Camera'),
- handler: () => {
- Camera.getPicture({
- destinationType: 0,
- sourceType: 1,
- saveToPhotoAlbum: false,
- targetWidth: 500,
- targetHeight: 500,
- allowEdit: true,
- }).then(
- (imageData) => {
- this.picture = 'data:image/jpeg;base64,' + imageData;
- },
- (err) => {
- console.log('Error', err);
- });
- }
- },
- {
- icon: 'image',
- text: this.translate.instant('From Gallery'),
- handler: () => {
- Camera.getPicture({
- destinationType: 0,
- sourceType: 2,
- saveToPhotoAlbum: false,
- targetWidth: 500,
- targetHeight: 500,
- allowEdit: true,
- }).then(
- (imageData) => {
- this.picture = 'data:image/jpeg;base64,' + imageData;
- },
- (err) => {
- console.log('Error', err);
- });
- }
- },
- {
- icon: 'close',
- text: this.translate.instant('Cancel'),
- role: 'cancel',
- handler: () => {
- //console.log('Cancel clicked');
- }
- }
- ]
- });
- actionSheet.present();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement