O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Taking a Photo with the CameraCaptureTask

The camera capture task is a chooser that is used to launch the built-in Camera app. If the user completes the task by taking and confirming a photo, the Completed event is raised and the event handler receives a PhotoResult object, which exposes a stream containing the image data.

For information on working with photo image streams, see Chapter 20, “Extending the Windows Phone Picture Viewer.”

The CameraCaptureTask should be defined as a field in your class, like so:

readonly CameraCaptureTask cameraCaptureTask                                     = new CameraCaptureTask();

Subscribe to the CameraCaptureTask.Completed event within your class constructor, as shown:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required