Popularity
7.5
Stable
Activity
7.2
-
1,746
189
284

Description

Win2D is an easy-to-use Windows Runtime API for immediate mode 2D graphics rendering with GPU acceleration. It is available to C#, C++ and VB developers writing apps for the Windows Universal Platform (UWP). It utilizes the power of Direct2D, and integrates seamlessly with XAML and CoreWindow.

Programming language: C++
License: GNU General Public License v3.0 or later
Tags: API     Graphics     2D     Direct2D    
Latest version: v1.0.0

Win2D alternatives and similar packages

Based on the "Graphics" category.
Alternatively, view Win2D alternatives based on common mentions on social networks and blogs.

  • Live-Charts

    Simple, flexible, interactive & powerful charts, maps, and gauges for .Net, LiveCharts2 can now practically run everywhere WPF, WinForms, Xamarin, Avalonia, WinUI, UWP.
  • ScottPlot

    Interactive plotting library for .NET
  • Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
  • Oxyplot

    A cross-platform plotting library for .NET
  • LiveCharts2

    Simple, flexible, interactive & powerful charts, maps and gauges for .Net, LiveCharts2 can now practically run everywhere Maui, Uno Platform, Blazor-wasm, WPF, WinForms, Xamarin, Avalonia, WinUI, UWP.
  • OpenTK

    The Open Toolkit library is a fast, low-level C# wrapper for OpenGL, OpenAL & OpenCL. It also includes windowing, mouse, keyboard and joystick input and a robust and fast math library, giving you everything you need to write your own renderer or game engine. OpenTK can be used standalone or inside a GUI on Windows, Linux, Mac.
  • Silk.NET

    The high-speed OpenGL, OpenCL, OpenAL, OpenXR, GLFW, SDL, Vulkan, Assimp, WebGPU, and DirectX bindings library your mother warned you about.
  • Helix Toolkit

    Helix Toolkit is a collection of 3D components for .NET.
  • Veldrid

    A low-level, portable graphics library for .NET.
  • LibVLCSharp

    Cross-platform .NET/Mono bindings for LibVLC
  • Interactive Data Display for WPF

    Interactive Data Display for WPF is a set of controls for adding interactive visualization of dynamic data to your application. It allows to create line graphs, bubble charts, heat maps and other complex 2D plots which are very common in scientific software. Interactive Data Display for WPF integrates well with Bing Maps control to show data on a geographic map in latitude/longitude coordinates. The controls can also be operated programmatically.
  • NGraphics

    NGraphics is a cross platform library for rendering vector graphics on .NET. It provides a unified API for both immediate and retained mode graphics using high quality native renderers.
  • LibTessDotNet

    C# port of the famous GLU Tessellator - prebuilt binaries now available in "releases" tab
  • SciChart

    Highest rated & Fastest WPF Charts, used by F1, NASA and more
  • RealTimeGraphX

    High performance real-time graph for WPF & UWP
  • VectSharp

    A light library for C# vector graphics
  • Aspose.Drawing

    Aspose.Drawing for .NET Examples
  • AssimpNet

    A cross-platform .NET Standard wrapper for the Open Asset Importer ("Assimp"). The library enables importing, processing, and exporting of 3D models for rendering in graphics/game applications. Over 40 formats are supported for importing (e.g. OBJ, FBX, GLTF, 3DS, Collada) and a subset of those formats can be exported to (e.g. OBJ, GLTF, 3DS, Collada). Mesh processing features allow for mesh data to be generated or optimized for real-time rendering.

Do you think we are missing an alternative of Win2D or a related project?

Add another 'Graphics' Package

README

Transitioning Win2D to Reunion is In-Progress

Moving Win2D over to WindowsAppSdk and WinUI3 is a work in progress, and some features such as CanvasAnimatedControl have partial or no support.

Win2D

Win2D is an easy-to-use Windows Runtime API for immediate mode 2D graphics rendering with GPU acceleration. It is available to C#, C++ and VB developers writing apps for WinUI3. It utilizes the power of Direct2D, and integrates seamlessly with XAML.

Where to get it
How to use it
More info

Code Example

To give you a flavor of what the code looks like, here is a snippet of XAML:

xmlns:canvas="using:Microsoft.Graphics.Canvas.UI.Xaml"

<Grid>
    <canvas:CanvasControl Draw="canvasControl_Draw" ClearColor="CornflowerBlue" />
</Grid>

and C#:

void canvasControl_Draw(CanvasControl sender, CanvasDrawEventArgs args)
{
    args.DrawingSession.DrawEllipse(155, 115, 80, 30, Colors.Black, 3);
    args.DrawingSession.DrawText("Hello, world!", 100, 100, Colors.Yellow);
}

or C++/CX:

void MainPage::CanvasControl_Draw(CanvasControl^ sender, CanvasDrawEventArgs^ args)
{
    args->DrawingSession->DrawEllipse(155, 115, 80, 30, Colors::Black, 3);
    args->DrawingSession->DrawText("Hello, world!", 100, 100, Colors::Yellow);
}

or C++/WinRT:

void MainPage::CanvasControl_Draw(CanvasControl const& sender, CanvasDrawEventArgs const& args)
{
    args.DrawingSession().DrawEllipse(155, 115, 80, 30, Colors::Black(), 3);
    args.DrawingSession().DrawText(L"Hello, world!", 100, 100, Colors::Yellow());
}

or VB:

Sub canvasControl_Draw(sender As CanvasControl, args As CanvasDrawEventArgs)
    args.DrawingSession.DrawEllipse(155, 115, 80, 30, Colors.Black, 3)
    args.DrawingSession.DrawText("Hello, world!", 100, 100, Colors.Yellow)
End Sub

Using Win2D

The documentation explains how to install Visual Studio, add the Win2D NuGet package to your project, and get started using the API.

Building Win2D from source

Requirements
  • Visual Studio 2019 16.9 with Tools for Universal Windows Apps 15.0.27428.01 and Windows SDK 18362
Clone Repository
Build NuGet Packages
  • Launch 'Developer Command Prompt for VS2019'
  • Change directory to your cloned Win2D repository and run 'build'
Point Visual Studio at the resulting 'bin' directory
  • In Visual Studio, go to 'Tools' -> 'NuGet Package Manager' -> 'Package Manager Settings'
  • Choose 'Package Sources'
  • Click the '+' button to add a new source
  • Set 'Name' to 'Win2D' (or a name of your choosing)
  • Set 'Source' to the full path to the 'bin' directory (inside your cloned Win2D repository)
  • Click the 'Update' button
  • Click 'OK'

Locally built versions of Win2D are marked as prerelease, so you must change the 'Stable Only' setting to 'Include Prerelease' when adding them to your project.


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.


*Note that all licence references and agreements mentioned in the Win2D README section above are relevant to that project's source code only.