c# - 如何使用 WinUI 3.0 桌面应用程序的 Project Reunion 模板在 Windows 应用程序中添加相机功能?
问题描述
我正在使用 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 不支持它。
让我知道我在这里遗漏了什么。
提前致谢。
解决方案
Currently not available in WinUI3 (Reunion).
推荐阅读
- javascript - 挣扎着通过导航传递props,相信和我的AysncyStorage set multiple有关
- python-3.x - Vigenere Cipher:遇到问题
- python - Python maxplotlib - boxplot 子图 + 散点图
- javascript - 如何在javascripts中计算日间添加的多个输入onchange of value的值
- python - 使用特定字符串过滤数据框的列
- python-3.x - 如何在for循环中为字符串打印空格而不是下划线
- powerbi - DAX 测量。如何计算性能划分目标
- python - SQLAlchemy 一对(多的一些)关系
- javascript - 无法使用函数在数组中定位 JS 生成的按钮,出现“无法读取属性 'setAttribute' of null”错误
- apache-flink - Ververica 平台| Flink 所需的上下文属性不匹配