1
0
Форкнуть 0
Photo Editor is a UWP photo viewing and editing sample that highlights development with C++/WinRT.
Перейти к файлу
drew batchelor d57f02afab
Merge pull request #13 from microsoft/users/GitHubPolicyService/9e209697-5c44-4633-aaf3-af66f85fd29a
Adding Microsoft SECURITY.MD
2022-09-08 10:27:24 -07:00
PhotoEditor Fixing couple of typos 2021-09-03 12:48:29 -07:00
Screenshots Initial release 2018-06-08 13:41:55 -07:00
.gitattributes Initial release 2018-06-08 13:41:55 -07:00
.gitignore Initial release 2018-06-08 13:41:55 -07:00
CONTRIBUTING.md Initial release 2018-06-08 13:41:55 -07:00
LICENSE.md Initial release 2018-06-08 13:41:55 -07:00
PhotoEditor.sln Initial release 2018-06-08 13:41:55 -07:00
README.md Update README.md 2020-05-18 08:11:34 -07:00
SECURITY.md Microsoft mandatory file 2022-08-30 09:37:30 +00:00

README.md

page_type languages products statusNotificationTargets
sample
cppwinrt
cpp
windows
windows-uwp
codefirst@microsoft.com

Photo Editor C++/WinRT sample application

The Photo Editor application is a Universal Windows Platform (UWP) sample 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. 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.

Note - This sample is targeted and tested for Windows 10, version 2004 (10.0; Build 19041), and Visual Studio 2019. If you prefer, you can use project properties to retarget the project(s) to Windows 10, version 1903 (10.0; Build 18362).

PhotoEditor sample showing the image collection page, editing page, and editing controls

Features

Photo Editor primarily demonstrates:

Universal Windows Platform development

Prerequisites

  • Windows 10. Minimum: Windows 10, version 1809 (10.0; Build 17763), also known as the Windows 10 October 2018 Update.
  • Windows 10 SDK. Minimum: Windows SDK version 10.0.17763.0 (Windows 10, version 1809).
  • Visual Studio 2019 (or Visual Studio 2017). You can use the free Visual Studio Community Edition to build and run Windows Universal Platform (UWP) apps.
  • You'll need to have a collection of images available in your local Pictures folder. If there are no images or photos available at that location, the app will not show anything but the background when you run it.

You can optionally install the C++/WinRT Visual Studio Extension (VSIX). When you open the project, it will install the Microsoft.Windows.CppWinRT NuGet package.

To get the latest updates to Windows and the development tools, and to help shape their development, join the Windows Insider Program.

Running the sample

The default project is PhotoEditor and you can Start Debugging (F5) or Start Without Debugging (Ctrl+F5) to try it out, just make sure to set the platform target appropriately. The app will run in the emulator or on physical devices.

Code at a glance

If you're just interested in code snippets for certain areas, and don't want to browse or run the full sample, check out the following files.

A custom runtime class that represents a photo.

The first page that loads the photos from the Pictures Library and displays a tiled thumbnail view.

Tapping a photo from the MainPage thumbnail view will take you to the photo editor page, where Win2D effects are toggled, set, and chained together.

External libraries used in this sample

Changing the project's target platform version

If you build the project on a given target platform version (TargetPlatformVersion in the project file), and then you retarget and rebuild, you may see this error message in Visual Studio: "error MIDL2003: [msg]redefinition [context]: ". If you do, then here are some options to resolve the issue.

  • Sometimes, the resolution is as simple as deleting the file \Windows-appsample-photo-editor\PhotoEditor\<CONFIGURATION>\XamlMetaDataProvider.idl, and rebuilding.
  • If that doesn't clear the issue, then you can try deleting all temporary/generated folders and files, and rebuilding.
  • If you haven't made changes, then you can alternatively re-clone the repo, re-target, and build.