Window Phone 8.1运行时中缺少CameraCaptureTask ???

时间:2014-08-13 09:48:31

标签: runtime windows-phone-8.1 universal

如何在“选配器”选项卡完成时显示相机应用程序并捕获。 我在窗口电话中使用了CameraCaptureTask。 http://msdn.microsoft.com/en-us/library/windows/apps/hh394006%28v=vs.105%29.aspx。 但它在窗口电话8.1运行时中丢失了。

1 个答案:

答案 0 :(得分:4)

在Windows Phone 8.1 XAML应用程序中,您可以使用FileOpenPicker从图片库或相机中选择am image。确保已将“.jpg”添加到选取器文件类型,否则相机按钮可能不会显示。以下是示例代码:

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();