【问题标题】:CameraCaptureTask missing in Window Phone 8.1 runtime???Window Phone 8.1 运行时中缺少 CameraCaptureTask ???
【发布时间】:2014-08-17 03:36:26
【问题描述】:

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

【问题讨论】:

  • CameraCaptureTask 仅适用于 Silverlight。要在 Runtime 中拍照,您必须使用 MediaCapture - this answer 可能会有所帮助。
  • 你知道 MediaCapture 中有什么方法,比如 CameraCaptureTask.show(),在 WP 中显示相机应用程序默认值并从中捕获图片

标签: runtime windows-phone-8.1 universal


【解决方案1】:

在 Windows Phone 8.1 XAML 应用程序中,您可以使用 FileOpenPicker 从图片库或相机中选择图片。确保您已将“.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();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多