Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49235

How to select an image in my gallery

$
0
0

@durvilchat wrote:

Hi please help me I would like to select an image in the gallery of my phone and when I try it does not work, see my code thank you.


    selectImage(): Promise<any> {
        return new Promise(resolve => {
            let cameraOptions: CameraOptions = {
                sourceType: this._CAMERA.PictureSourceType.PHOTOLIBRARY,
                destinationType: this._CAMERA.DestinationType.DATA_URL,
                quality: 100,
                targetWidth: 320,
                targetHeight: 240,
                encodingType: this._CAMERA.EncodingType.JPEG,
                correctOrientation: true
            };

            this._CAMERA.getPicture(cameraOptions)
                .then((data) => {
                    this.cameraImage = "data:image/jpeg;base64," + data;
                    resolve(this.cameraImage);
                });


        });
    }

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>