Using the CameraCaptureTask in Windows Phone 7

The CameraCaptureTask allows the Windows Phone 7 App to launch the Camera Application .

This will be useful when the user wants to take a photo from the App and then do something useful with the Photo like saving the photo that was taken etc .

This blog post discusses how to use the CameraCaptureTask and display the photo that was taken on to the Image Control in Windows Phone 7 .

The CameraCaptureTask is defined in the namespace Microsoft.Phone.Tasks .

Using Microsoft.Phone.Tasks;
private void button1_Click(object sender, RoutedEventArgs e)
     CameraCaptureTask cameraCapture = new CameraCaptureTask();
     cameraCapture.Completed += new EventHandler<PhotoResult>(cameraCapture_Completed);


void cameraCapture_Completed(object sender, PhotoResult e)
     if (e.TaskResult == TaskResult.OK)
        BitmapImage bitImage = new BitmapImage();
        //image is a Image Control in the form
        image1.Source = bitImage;


When the photo is captured via Camera and Accepted , it can be accessed through the ChosenPhoto of the PhotoResult .

In the above example , the photo is displayed on the Image Control .

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Reply


Interesting BlogPosts to read

How to get an Enumerator from range of elements from ArrayList in C# ?
The code snippet shown in this blog post demonstrates how you can get the enumeraor from a range of ...
How to check for the column name in an SqlDataReader Object in C# ?
When working in ADO.NET for data access , there are times when you want to check to see if a column ...
Download - Pokemon Go for for Windows 10 (Third Party app)
Pokemon Go is one of the popular AR games for android and iOS devices and now , the game is made ava...