Window Phone 8.1 运行时缺少 CameraCaptureTask ??? [英] CameraCaptureTask missing in Window Phone 8.1 runtime???

查看:62
本文介绍了Window Phone 8.1 运行时缺少 CameraCaptureTask ???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在选择器"选项卡完成时显示相机应用程序和捕获.我在窗口电话中使用了 CameraCaptureTask.http://msdn.microsoft.com/en-us/library/windows/apps/hh394006%28v=vs.105%29.aspx.但它在 window phone 8.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.

推荐答案

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

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

这篇关于Window Phone 8.1 运行时缺少 CameraCaptureTask ???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆