Win2D samples

These sample projects show how to use the Win2D graphics API.

  • Example Gallery is the main Win2D demo and sample application. This is a C# XAML application, and contains many different examples showing various capabilities of Win2D, with a menu to select between them. Start here to get an idea of what Win2D can do and how use it.

    • Example Gallery is also available in the Store.
  • Composition Example shows how to use Win2D to draw onto a Windows.UI.Composition drawing surface or swapchain.

  • CoreWindow Example is a C# application that draws directly to a CoreWindow, without using XAML.

  • Simple Sample is, yup, you guessed it! Pretty much the simplest possible app that uses Win2D - it's our version of the venerable "hello world".

Most of the samples contain two different Visual Studio solution files. The *.uap.sln version is for Windows 10 (Universal Windows Platform), while *.81.sln is for Windows 8.1 and Windows Phone 8.1.

Composition Example only contains a .uap.sln, because it does not support Windows 8.1.

These samples reference the NuGet packages Win2D.uwp or Win2D.win81, which will be automatically downloaded when you build the sample, so there is no need to separately install Win2D itself. Win2D source code is also available for those who like to see how the sausage is made.

An additional set of unofficial samples were created during a July 2015 app building exercise:

For more information about Win2D, see its documentation.


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.



Win2D samples

这些示例项目显示了如何使用Win2D图形API。

  • 示例库是主要的Win2D演示和示例应用程序。这是一个C#XAML 应用程序,并包含许多不同的示例显示各种功能 Win2D,有一个菜单来选择它们之间。从这里开始,了解Win2D可以做什么 做和使用它。

    • 示例图库也可用 商店
  • 组合示例显示如何使用Win2D绘制到Windows.UI.Composition 绘图面或交换链。

  • CoreWindow示例是一个直接绘制到CoreWindow的C#应用​​程序, 而不使用XAML。

  • 简单样本是,你猜,你是!几乎是最简单的应用程序 使用Win2D - 这是我们的版本的尊贵的你好世界。

大多数示例包含两个不同的Visual Studio解决方案文件。 * .uap.sln 版本适用于Windows 10(通用Windows平台),而* .81.sln适用于Windows 8.1 和Windows Phone 8.1。

组合示例仅包含.uap.sln,因为它不支持Windows 8.1。

这些示例引用了NuGet软件包 Win2D.uwp Win2D.win81 ,这将是 自动下载时,您构建样本,所以没有必要 单独安装Win2D本身。 Win2D 源代码 也适合那些喜欢看香肠的人。

在2015年7月期间又创造了一系列非官方的样本 应用程序构建练习

有关Win2D的更多信息,请参阅其文档


该项目采用了 Microsoft开源行为准则。 有关详细信息,请参阅行为准则常见问题解答或联系人 opencode@microsoft.com 以及任何其他问题或意见。




相关问题推荐