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.
Перейти к файлу
Sergio Pedri 59eda0efb1 Merged PR 32855: Update WASDK release notes to 1.3.0
This PR prepares the WASDK branch for the 1.3.0 release.

----
#### AI description  (iteration 1)
#### PR Classification
Documentation update

#### PR Summary
This pull request updates the release notes and dependencies for the Win2D-WinUI 1.3.0 release.
- Updated `CHANGELOG.md` with release notes for version 1.3.0.
- Updated `WindowsAppSdkVersion` in `build/WindowsAppSdk.common.props` and related package files.
- Updated `winrt.projection.csproj` to version 1.3.0 and lowered `WindowsSdkPackageVersion`.
- Updated `Microsoft.Windows.CSWinRT` version in multiple project files.
- Deleted `build/nuget/VERSION-PRERELEASE`.
2024-10-11 16:04:27 +00:00
.config Merged PR 28443: Move Win2D to OneBranch pipelines 2023-11-16 14:50:01 +00:00
.pipelines Merged PR 28443: Move Win2D to OneBranch pipelines 2023-11-16 14:50:01 +00:00
build Merged PR 32855: Update WASDK release notes to 1.3.0 2024-10-11 16:04:27 +00:00
eng Update the nightly WinAppSDK-based pipeline to run jobs in parallel 2023-02-03 14:46:48 -05:00
tools Merged PR 28443: Move Win2D to OneBranch pipelines 2023-11-16 14:50:01 +00:00
winrt Merged PR 32855: Update WASDK release notes to 1.3.0 2024-10-11 16:04:27 +00:00
.gitattributes Create - initial gitignore and gitattributes 2014-04-28 10:34:38 -07:00
.gitignore Merged PR 32714: Remove PFX file from Win2D to comply with KPI [SFI-ES3.3.1] Exposed Secrets 2024-09-30 23:06:19 +00:00
.sscignore Merged PR 22672: Ignore CFS warning since the pipeline works around it 2022-09-28 17:04:34 +00:00
CHANGELOG.md Merged PR 32855: Update WASDK release notes to 1.3.0 2024-10-11 16:04:27 +00:00
CONTRIBUTING.md Merged PR 32714: Remove PFX file from Win2D to comply with KPI [SFI-ES3.3.1] Exposed Secrets 2024-09-30 23:06:19 +00:00
LICENSE.txt Change license from Apache 2.0 to MIT - manually update files that include handwritten license text 2015-07-06 21:37:39 -07:00
Microsoft.Graphics.Win2D.sln Merged PR 25326: Enable Managed Tests in VS Test Explorer 2023-04-17 20:50:58 +00:00
README.md Merged PR 24469: Port ICanvasImageInterop features and other new APIs from UWP branch 2023-03-10 11:08:34 +00:00
SECURITY.md Microsoft mandatory file 2022-08-31 15:23:16 +00:00
Win2D.proj Update TargetPlatformVersion to 22621, remove net5 from name of project, change nuget dependency 2023-02-21 10:52:32 -05:00
build.cmd Merged PR 20415: Update Win2D to WinAppSDK 1.0.3 2022-04-28 15:37:47 +00:00
global.json Update TargetPlatformVersion to 22621, remove net5 from name of project, change nuget dependency 2023-02-21 10:52:32 -05:00
nuget.config Merged PR 32524: Move Win2D.winappsdk to a compliant nuget feed 2024-09-12 23:08:30 +00:00
runbuild.ps1 Merged PR 16988: Fix AnyCPU compilation 2021-09-08 14:44:56 +00:00
smoke.cmd Remove 8.1 support: assorted other cleanups 2018-02-23 15:25:05 -08:00

README.md

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.

Visit the DirectX Landing Page for more resources for DirectX developers.

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 opencode@microsoft.com with any additional questions or comments.