This repository contains samples that demonstrate the use of Window.UI.Composition APIs in WPF, Windows Forms, and C++ Win32 applications.
The Visual layer provides a high performance, retained-mode API for graphics, effects, and animations. It's the foundation for UI across Windows 10 devices. UWP XAML controls are built on the Visual layer, and it enables many aspects of the Fluent Design System, such as Light, Depth, Motion, Material, and Scale.
You can now use UWP APIs in non-UWP desktop applications to enhance the look, feel, and functionality of your WPF, Windows Forms, and C++ Win32 applications, and take advantage of the latest Windows 10 UI features that are only available via UWP.
The Visual layer lets you create engaging experiences by using lightweight compositing of custom drawn content (visuals) and applying powerful animations, effects, and manipulations on those objects in your application. The Visual layer doesn't replace any existing UI framework; instead, it's a valuable supplement to those frameworks.
You can use the Visual layer to give your application a unique look and feel, and establish an identity that sets it apart from other applications. It also enables Fluent Design principles, which are designed to make your applications easier to use, drawing more engagement from users. For example, you can use it to create visual cues and animated screen transitions that show relationships among items on the screen.
For related documentation, see Modernize your desktop app using the Visual layer
Minimum requirements for using the Visual layer in desktop apps are listed here. Individual samples might have different requirements, which are listed in the readme for the sample.
Sample | |
---|---|
Hello Composition sampleDemonstrates how to set up a project to use Composition APIs in a C++ Win32 app.See the Using the Visual layer with Win32 tutorial for more info. | |
Hello Vectors sampleDemonstrates how to use vectors in the Visual layer. | |
Virtual Surfaces sampleDemonstrates how to use virtual surfaces in the Visual layer. | |
Advanced Color sampleDemonstrates how to load advanced color (HDR, High Color Gamut, High precision) images into a Virtual Surface and use an Interaction Tracker that helps create a smooth scrollable surface that responds well to touch, mouse, and precision touchpad. | |
Screen Capture sampleDemonstrates how to use screen capture APIs. |
Sample | |
---|---|
Hello Composition sampleDemonstrates how to set up a project to use Composition APIs in a Windows Forms app.See the Using the Visual layer with Windows Forms tutorial for more info. | |
Visual Layer Integration sampleDemonstrates how to use a bar graph created with Composition APIs in a Windows Forms app. | |
Win2D Effects (Acrylic) sampleDemonstrates how to use Win2D effects to show an acrylic overlay on top of a picture. |
Sample | |
---|---|
Hello Composition sampleDemonstrates how to set up a project to use Composition APIs in a WPF app.See the Using the Visual layer with WPF tutorial for more info. | |
Visual Layer Integration sampleDemonstrates how to use a bar graph created with Composition APIs in a WPF app. | |
Screen Capture sampleDemonstrates how to use screen capture APIs. | |
Win2D Effects (Acrylic) sampleDemonstrates how to use Win2D effects to show an acrylic overlay on top of a picture. |
While many Visual Layer features work the same when hosted in a desktop application as they do in a UWP app, some features do have limitations. Here are some of the limitations to be aware of:
While we expect to at a later date, this project is not currently accepting contributions. For now, if you have any feedback or questions, please open an Issue on GitHub for the team.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments
Copyright © Microsoft Corporation. All rights reserved. This program/project is and its use is subject to the MIT License