[UWP]打开默认相机应用程序 [英] [UWP] Open Default Camera App

查看:94
本文介绍了[UWP]打开默认相机应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用需要相机集成。有两种可能的方法:在我们的应用程序中构建一个摄像头,或让我们的应用程序跳转到标准的Windows 10 Camera应用程序。

Our app needs camera integration. There are two possible approaches: build a camera in to our app, or have our app jump off to the standard Windows 10 Camera app.

这两种方法都是有效的。在Silverlight中,我们已经完成了两者,并且我们为用户提供了使用它们的选项。他们都有自己的优点和缺点。特别是,原生相机应用程序具有焦点等,默认情况下不会出现在应用程序内的
相机中。我设法在UWP样本回购中获取相机样本,尽管它们是完全破坏了源代码管理。但是,这些示例仅演示了如何在我们的应用程序中使用相机。他们没有告诉我们如何将
跳到原生相机应用程序。

Both approaches are valid. In Silverlight, we've done both, and we give the user the option to use either. They both have their advantages and disadvantages. In particular, the native camera app has focus etc. that doesn't appear by default with an in-app camera. I managed to get the camera samples in the UWP Samples repo working despite the fact that they are completely broken in source control. However, these samples only demonstrate how to use the camera inside our app. They don't show us how to jump off to the native camera app.

如何在Windows UWP中启动原生Windows相机应用程序?

How do I launch the native windows camera app in Windows UWP?

这就是我们在Silverlight中的做法:

This is how we do it in Silverlight:

                //Start the camera
                using (dynamic shell = AutomationFactory.CreateObject("WScript.Shell"))
                {
                        shell.Run("microsoft.windows.camera:");
                    }
                }


UWP中的等价物是什么?

What's the equivalent in UWP?

推荐答案

您好,

您可以使用相机捕获用户界面。 

You can use the camera capture UI. 

请参阅:  指南
相机捕获用户界面

Please see: Guidelines for the camera capture UI

"摄像头captureUI对话框使用户能够使用内置摄像头UI在具有嵌入式或附加摄像头的设备上捕获照片或视频。作为捕获体验的一部分,用户可以在返回到调用应用程序之前裁剪他们捕获的照片并修剪他们捕获的
视频。此外,用户还可以在拍摄照片或视频之前调整一些相机设置,如亮度,对比度和曝光。"

"The camera captureUI dialog enables users to capture photos or videos on devices that have an embedded or attached camera using the built-in camera UI. As part of the capture experience, users can crop their captured photos and trim their captured videos before they return to the calling application. In addition, users can also adjust some of the camera settings such as brightness, contrast, and exposure before capturing a photo or a video."

请参阅:  用CameraCaptureUI捕获
照片和视频

Please see: Capture photos and video with CameraCaptureUI

有问候,

Krunal Parekh 

Krunal Parekh 


这篇关于[UWP]打开默认相机应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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