【发布时间】: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