【问题标题】:How to add camera functionality in windows app using Project Reunion template for WinUI 3.0 desktop app?如何使用 WinUI 3.0 桌面应用程序的 Project Reunion 模板在 Windows 应用程序中添加相机功能?
【发布时间】:2021-07-07 14:00:58
【问题描述】:

我正在使用 Visual Studio 2019 中的 Project Reunion WinUI 模板开发桌面应用程序。我们需要从应用程序中捕获图像并保存它。

我试过 CameraCaptureUI(这在 UWP 应用程序中有效,但在 Project Reunion 中无效)

代码:

CameraCaptureUI dialog = new CameraCaptureUI();
Size aspectRatio = new Size(16, 9);
dialog.PhotoSettings.CroppedAspectRatio = aspectRatio;
StorageFile file = await dialog.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (file == null)
{
}

错误:

我们尝试使用 CaptureElement Reference,但 Project Reunion 不支持它。

让我知道我在这里遗漏了什么。

提前致谢。

【问题讨论】:

    标签: c# windows desktop-application winui winui-3


    【解决方案1】:

    目前在 WinUI3 (Reunion) 中不可用。

    https://github.com/microsoft/microsoft-ui-xaml/issues/4710

    【讨论】:

    • 是的,WinUI3 (Reunion) 尚不支持 CameraCaptureUI 和许多其他控件。我已经切换到 UWP。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-09-14
    • 1970-01-01
    • 2023-04-02
    • 2011-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多