windows-8 - 相机打开时打开设置 super 按钮会在Windows 8/WinRT中关闭相机

标签 windows-8 windows-store-apps winrt-xaml

我正在使用CameraCaptureUI在应用程序中打开相机;这是iam使用的代码

        var camera = new CameraCaptureUI();
        camera.PhotoSettings.AllowCropping = false;
        var file = await camera.CaptureFileAsync(CameraCaptureUIMode.Photo);
        if (file != null)
        {
            var fileStream = await file.OpenAsync(FileAccessMode.Read);
            var bitmapImage = new BitmapImage();
            bitmapImage.SetSource(fileStream);
            var sourceImage = new WriteableBitmap(bitmapImage.PixelWidth, bitmapImage.PixelHeight);
            var imageStream = await file.OpenAsync(FileAccessMode.Read);
            sourceImage.SetSource(imageStream);

        }

但是问题不在于相机。在相机打开期间。如果打开设置 super 按钮,则等待功能将取消var file = await camera.CaptureFileAsync(CameraCaptureUIMode.Photo); [文件返回null],并隐藏CameraCapture UI。我正在尝试做的是,即使用户打开了护身符,我也需要始终打开相机。我如何在WinRT中实现这一目标

最佳答案

为了解决您的问题,您需要在专门为特殊情况设计的UI中停止使用CameraCaptureUI并开始使用<CaptureElement/>

我在一篇文章中对此进行了帮助。 Here

祝你好运!

关于windows-8 - 相机打开时打开设置 super 按钮会在Windows 8/WinRT中关闭相机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16807583/

相关文章:

c++ - Windows 路径处理库

java - 如何在后台运行程序

c# - CanExecute() 返回 true 并且按钮仍然被禁用

xaml - 删除先前在 WinRT 的 DataTemplate 中使用的图像文件时访问被拒绝

c# - 以编程方式(平滑地)动画化 ScrollViewer

windows-8 - Webview 在外部浏览器中打开链接时忽略 #(hash) 参数

c# - 将 cookie 设置为 WebView 控件

windows-store-apps - 在没有应用程序商店的多台设备上部署 Windows 8 应用程序

xaml - 如何将 C++/CX 库添加到针对任何 CPU 的 Windows 应用商店解决方案

javascript - 解析数据馈送导致 WinJS 中出现无效字符错误