locked
WP 8.1 Universal App How to take a picture RRS feed

  • Question

  • Hi,

    I am working on an universal app W8.1/WP8.1 and I am trying to implement a feature where the user can take a picture of himself and save the image on the device. Whereas it is trivial to implement for W8.1 I can't find a way to do it for WP8.1

    Here is the code I use for W8.1:

     private async Task TakePhoto()
            {
                var l_camera = new CameraCaptureUI();
                l_camera.PhotoSettings.MaxResolution = CameraCaptureUIMaxPhotoResolution.HighestAvailable;
                l_camera.PhotoSettings.CroppedAspectRatio = new Size(3, 4);
                var photo = await l_camera.CaptureFileAsync(CameraCaptureUIMode.Photo);
                await this.NewPlayer.CreateAvatar(photo);
            }

    I expected to either use the exact same code for WP or at the very least require a #if and use WP

    CameraCaptureTask 

    but neither works on universal app.

    Any pointers would be appreciated

    Rgds

    A

    Saturday, May 17, 2014 8:03 AM

All replies