1

How to show camera app and capture when Chooser tab completed. I used CameraCaptureTask in window phone. http://msdn.microsoft.com/en-us/library/windows/apps/hh394006%28v=vs.105%29.aspx. But it missing in window phone 8.1 runtime.

ltvu93
  • 91
  • 1
  • 12
  • *CameraCaptureTask* is only for Silverlight. To take a photo in Runtime you will have to use *MediaCapture* - [this answer](http://stackoverflow.com/a/23606620/2681948) may help a little. – Romasz Aug 13 '14 at 10:15
  • Do you know what method in MediaCapture like CameraCaptureTask.show(), to show camera app defalut in WP and capture picture from it – ltvu93 Aug 13 '14 at 14:01

1 Answers1

4

In Windows Phone 8.1 XAML apps you can use the FileOpenPicker to select am image either from the picture library, or from the camera. Make sure you have added ".jpg" to the picker file types, otherwise the camera button may not show. Here is sample code:

FileOpenPicker picker = new FileOpenPicker();
picker.FileTypeFilter.Add(".png");
picker.FileTypeFilter.Add(".jpg");

picker.ContinuationData["DATA"] = "MYDATA";  // The app may be closed while displaying the picker dialog, and this data will be passed back to the application on activation.

picker.PickSingleFileAndContinue();
Jogy
  • 2,465
  • 1
  • 14
  • 9