照片编辑器 C++/WinRT 示例应用程序Photo Editor C++/WinRT sample application
备注
该示例面向 Windows 10 版本 1903(10.0 内部版本 18362)和 Visual Studio 2019,且已经过测试。The sample is targeted and tested for Windows 10, version 1903 (10.0; Build 18362), and Visual Studio 2019. 如果愿意,可以使用项目属性使项目重新面向 Windows 10 版本 1809(10.0 内部版本 17763),并/或使用 Visual Studio 2017 打开示例。If you prefer, you can use project properties to retarget the project(s) to Windows 10, version 1809 (10.0; Build 17763), and/or open the sample with Visual Studio 2017.
若要克隆或下载此示例应用程序,请参阅代码示例库中的照片编辑器 C++/WinRT 示例应用程序。To clone or download the sample application, see Photo Editor C++/WinRT sample application on the code samples gallery.
照片编辑器应用程序是一个通用 Windows 平台 (UWP) 示例应用程序,它通过 C++/WinRT 语言投影展示开发。The Photo Editor application is a Universal Windows Platform (UWP) sample application that showcases development with the C++/WinRT language projection. 此示例应用程序允许你从图片库检索照片,然后使用分类的照片效果编辑选择的图像。The sample application allows you to retrieve photos from the Pictures library, and then edit the selected image with assorted photo effects. 在示例的源代码中,你将看到大量的常见做法 — 如数据绑定和异步操作— 使用 C++/WinRT 投影执行。In the sample's source code, you'll see a number of common practices—such as data binding, and asynchronous actions and operations—performed using the C++/WinRT projection. 下面是示例演示的一些特定功能。Here are some of the specific features demonstrated by the sample.
- 通过 Windows 运行时 (WinRT) API 使用标准 C++17 语法和库。Use of Standard C++17 syntax and libraries with Windows Runtime (WinRT) APIs.
- 使用协同程序,包括使用 co_await、co_return、IAsyncAction和IAsyncOperationTResult <> 。Use of coroutines, including the use of co_await, co_return, IAsyncAction, and IAsyncOperation<TResult>.
- 创建和使用自定义 Windows 运行时类(运行时类)投影类型和实现类型。Creation and use of custom Windows Runtime class (runtime class) projected types and implementation types. 有关这些术语的详细信息,请参阅通过 C++/WinRT 使用 API 和使用 C++/WinRT 创作 API。For more info about these terms, see Consume APIs with C++/WinRT and Author APIs with C++/WinRT.
- 事件处理,包括使用自动撤销事件令牌。Event handling, including the use of auto-revoking event tokens.
- 使用外部 Win2D NuGet 程序包和 Windows::UI::Composition 呈现图像效果。Use of the external Win2D NuGet package, and Windows::UI::Composition, for image effects.
- XAML 数据绑定,包括 {x:Bind} 标记扩展。XAML data binding, including the {x:Bind} markup extension.
- XAML 样式和 UI 自定义,包括连贯动画。XAML styling and UI customization, including connected animations.
另请参阅可在哪里找到 C++/WinRT 示例应用?。Also see Where can I find C++/WinRT sample apps?.