NVello 0.11.0-main.22e4dabe

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

NVello

NVello is a C# binding for Vello.

Usage

using NVello;

using var renderer = new Renderer(256, 256);

renderer.Paint = new GradientPaint(Gradient.Linear(new(0, 0), new(256, 256),
    (0f, Color.FromRgb(0x1E294B)), (1f, Color.FromRgb(0xFF5D8F))));
renderer.FillRect(new Rect(0, 0, 256, 256));

renderer.Paint = Color.White.WithAlpha(0.8f);
renderer.FillPath(new NVello.Path().AddCircle(new Point(128, 128), 80));

renderer.Stroke = new Stroke(4).WithDashes(0, 12, 6);
renderer.Paint = Color.Black;
renderer.StrokeRect(new Rect(32, 32, 224, 224));

using var pixmap = new Pixmap(256, 256);
renderer.Render(pixmap);           // premultiplied RGBA8, pixmap.DataSpan
pixmap.SavePng("out.png");

// Or straight into your own buffer (width * height * 4 bytes).
var buffer = new byte[256 * 256 * 4];
renderer.Render(buffer, 256, 256);

Layers, masks, images, and text:

renderer.PushClipLayer(new NVello.Path().AddRoundedRect(new Rect(16, 16, 240, 240), 24));
renderer.PushBlendLayer(BlendMode.Multiply);
// ... draw ...
renderer.PopLayer();
renderer.PopLayer();

using var image = Pixmap.FromPngFile("texture.png");
var id = renderer.RegisterImage(image);
renderer.Paint = new ImagePaint(id, new ImageSampler(Extend.Repeat));

using var font = Font.FromFile("Roboto-Regular.ttf");
renderer.FillGlyphs(font, glyphs, new GlyphRunOptions(FontSize: 24));
renderer.PushFilterLayer(Filter.DropShadow(8, 8, 6, Color.Black.WithAlpha(0.5f)));
// ... draw ...
renderer.PopLayer();
renderer.FilterEffect = Filter.Blur(2);   // per subsequent draw; null clears

NVello.Gpu

using NVello;
using NVello.Gpu;

using var device = new GpuDevice();
using var scene = new GpuScene(512, 512);
using var renderer = new GpuRenderer(device, GpuTextureFormat.Rgba8Unorm);
using var target = new GpuTexture(device, 512, 512);

scene.Paint = Color.FromRgb(0x1E294B);
scene.PushFilterLayer(Filter.DropShadow(8, 8, 6, Color.Black.WithAlpha(0.5f)));
scene.Paint = Color.White;
scene.FillPath(new NVello.Path().AddCircle(new Point(256, 256), 120));
scene.PopLayer();

renderer.Render(scene, target);
using var pixmap = target.ReadToPixmap();
pixmap.SavePng("gpu.png");
var handle = SurfaceHandle.Xlib(display, windowId);       // or .Wayland(display, surface)
using var device = new GpuDevice(new() { CompatibleSurface = handle });
using var surface = new GpuSurface(device, handle, width, height);
using var renderer = surface.CreateRenderer();
using var scene = new GpuScene(width, height);
// per frame
scene.Reset();
Draw(scene);
surface.Present(renderer, scene);
// on resize
surface.Configure(newWidth, newHeight);
scene.ResetAndResize(newWidth, newHeight);

NVello.Pixman

using NVello.Pixman;
using Pixman;

using var canvas = PixmanImage.CreateBits(PixmanInterop.Format, 512, 512);
renderer.Render(canvas);                 // vello writes into pixman's memory
using var wrapped = pixmap.AsPixmanImage(); // pixman reads a vello pixmap in place
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 was computed.  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.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on NVello:

Package Downloads
NVello.Gpu

.NET bindings for vello_gpu, the CPU+GPU (wgpu) renderer of the Vello 2D graphics engine

NVello.Pixman

Zero-copy interop between NVello (vello_cpu) pixmaps and pixman-dotnet images

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.11.0-main.22e4dabe 47 9/14/2026