PeachDrawing.Win2D 0.9.25

dotnet add package PeachDrawing.Win2D --version 0.9.25
                    
NuGet\Install-Package PeachDrawing.Win2D -Version 0.9.25
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PeachDrawing.Win2D" Version="0.9.25" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PeachDrawing.Win2D" Version="0.9.25" />
                    
Directory.Packages.props
<PackageReference Include="PeachDrawing.Win2D" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PeachDrawing.Win2D --version 0.9.25
                    
#r "nuget: PeachDrawing.Win2D, 0.9.25"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PeachDrawing.Win2D@0.9.25
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PeachDrawing.Win2D&version=0.9.25
                    
Install as a Cake Addin
#tool nuget:?package=PeachDrawing.Win2D&version=0.9.25
                    
Install as a Cake Tool

PeachDrawing.Win2D

A Win2D backend for PeachDrawing.Core: draw shapes, gradients, clips, layers, text and images onto a Win2dCanvas - hardware-accelerated Direct2D, into a drawing session you already have (a CanvasControl, a swap chain) or into an offscreen bitmap you read back or save - with no HTML, CSS or PDF involved. It is the sibling of the PDF writer (PeachDrawing.PDF), the SVG writer (PeachDrawing.Svg) and the raster canvas (PeachDrawing), and it records links so a host can make them clickable and open them with the system's default handler.

dotnet add package PeachDrawing.Win2D

Status: pre-1.0. Windows only (net10.0-windows10.0.19041.0), on Win2D 1.4 for the Windows App SDK. It is versioned in lockstep with PeachPDF (the same number for every release); until 1.0 the API may change between releases.

using PeachDrawing.Core;
using PeachDrawing.Win2D;

using var context = Win2dRenderContext.CreateSoftware();
using var composer = new Win2dComposer(context, widthPoints: 400, heightPoints: 200);

composer.Canvas.DrawRectangle(context.GetSolidBrush(PaintColor.FromArgb(255, 30, 144, 255)), 20, 20, 200, 100);

await using var file = File.Create("out.png");
await composer.SaveAsync(file);

Every native Win2D object the package creates has one owner and is released deterministically: a session or device you pass in is never disposed, one the package makes is disposed with its owner, and a canvas disposed with clips or layers still open unwinds them. See the guide for the full lifecycle table, the text engines (PeachDrawing.Text or DirectWrite), links, and the limitations.

Product Compatible and additional computed target framework versions.
.NET net10.0-windows10.0.19041 is compatible.  net11.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.25 50 10/31/2026
0.9.25-preview1 50 10/27/2026