Majorsilence.Forms.Headless 26.0.33

dotnet add package Majorsilence.Forms.Headless --version 26.0.33
                    
NuGet\Install-Package Majorsilence.Forms.Headless -Version 26.0.33
                    
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="Majorsilence.Forms.Headless" Version="26.0.33" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Majorsilence.Forms.Headless" Version="26.0.33" />
                    
Directory.Packages.props
<PackageReference Include="Majorsilence.Forms.Headless" />
                    
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 Majorsilence.Forms.Headless --version 26.0.33
                    
#r "nuget: Majorsilence.Forms.Headless, 26.0.33"
                    
#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 Majorsilence.Forms.Headless@26.0.33
                    
#: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=Majorsilence.Forms.Headless&version=26.0.33
                    
Install as a Cake Addin
#tool nuget:?package=Majorsilence.Forms.Headless&version=26.0.33
                    
Install as a Cake Tool

Majorsilence.Forms.Headless

An offscreen platform backend for Majorsilence.Forms: renders real frames and processes real input with no display, no window manager, and no windowing toolkit — just SkiaSharp.

Use it to unit-test UI logic, snapshot-render forms in CI, or generate images on a server.

Install

dotnet add package Majorsilence.Forms
dotnet add package Majorsilence.Forms.Headless

Unlike the desktop backend, this one is selected explicitly. HeadlessRenderer.Use() does it:

using Majorsilence.Forms;
using Majorsilence.Forms.Headless;

HeadlessRenderer.Use ();

Render a form to a PNG

HeadlessRenderer.Use ();

var form = new MainForm ();
HeadlessRenderer.CapturePng (form, 800, 600);          // first call lays out
var png = HeadlessRenderer.CapturePng (form, 800, 600);

File.WriteAllBytes ("form.png", png);

The first capture performs the layout pass, so capture twice when you need the settled frame.

Drive input in a test

HeadlessRenderer.Use ();

var clicks = 0;
var button = new Button { Text = "Click", Left = 20, Top = 20, Width = 120, Height = 40 };
button.Click += (_, _) => clicks++;

var form = new Form ();
form.Controls.Add (button);

HeadlessRenderer.CapturePng (form, 300, 200);   // force a layout pass
HeadlessRenderer.Click (form, 80, 40);          // center of the button

Assert.Equal (1, clicks);

Available: CapturePng, Click, MouseDown, MouseUp, MouseMove, KeyDown, KeyUp, TextInput. The keyboard methods return the framework's "handled" flag.

Why it exists

Beyond testing, this is the reference second backend. Because it shares no code with the Avalonia or Uno backends, anything that works here is genuinely going through the neutral IPlatformBackend/IWindowBackend seam rather than leaning on a specific toolkit — which is what keeps the same app able to target Avalonia today and Uno tomorrow.

Licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
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
26.0.33 18 8/25/2026
26.0.32 64 8/19/2026
26.0.31 92 8/17/2026
26.0.30 88 8/13/2026
26.0.29 92 8/8/2026
26.0.28 95 8/7/2026
26.0.27 102 8/6/2026
26.0.26 101 8/4/2026
26.0.25 102 8/1/2026
26.0.24 119 7/23/2026
26.0.23 103 7/14/2026
26.0.22 109 7/9/2026
26.0.18 115 7/7/2026
26.0.0 112 7/3/2026