在Windows 10全屏使用CameraCaptureUI

时间:2016-01-20 11:03:28

标签: c# camera windows-runtime

他们是否可以告诉CameraCaptureUI它应该以全屏模式启动,而不是小窗口?

来自链接网站的当前代码:

CameraCaptureUI cameraUI = new CameraCaptureUI();

Windows.Storage.StorageFile capturedMedia =
    await cameraUI.CaptureFileAsync(CameraCaptureUIMode.Video);

我的应用程序基于WinRT for Windows 8.1。

在Win 8客户端上,相机应用程序只是全屏启动,但使用Win 10客户端,它会在一个小窗口中打开相机应用程序

2 个答案:

答案 0 :(得分:5)

目前没有办法从UWP应用程序控制CameraCaptureUI窗口的大小。

开发团队意识到人们对此感到担忧,并且正在How can we improve the Windows dev platform?观看UserVoice请求。您可以在那里进行投票和评论,以帮助团队了解需求并确定适当的优先级。

答案 1 :(得分:0)

此代码显示如何使用CameraCaptureUI类拍摄照片。代码来自Camera capture UI sample的CapturePhoto.xaml.cs文件。当您调用异步方法CaptureFileAsync时,会出现与用户的对话框。

// Using Windows.Media.Capture.CameraCaptureUI API to capture a photo

 CameraCaptureUI dialog = new CameraCaptureUI();
 Size aspectRatio = new Size(16, 9);
 dialog.PhotoSettings.CroppedAspectRatio = aspectRatio;

 StorageFile file = await dialog.CaptureFileAsync(CameraCaptureUIMode.Photo);