CodeBrix.Imaging.Drawing.ApacheLicenseForever
1.0.238.425
dotnet add package CodeBrix.Imaging.Drawing.ApacheLicenseForever --version 1.0.238.425
NuGet\Install-Package CodeBrix.Imaging.Drawing.ApacheLicenseForever -Version 1.0.238.425
<PackageReference Include="CodeBrix.Imaging.Drawing.ApacheLicenseForever" Version="1.0.238.425" />
<PackageVersion Include="CodeBrix.Imaging.Drawing.ApacheLicenseForever" Version="1.0.238.425" />
<PackageReference Include="CodeBrix.Imaging.Drawing.ApacheLicenseForever" />
paket add CodeBrix.Imaging.Drawing.ApacheLicenseForever --version 1.0.238.425
#r "nuget: CodeBrix.Imaging.Drawing.ApacheLicenseForever, 1.0.238.425"
#:package CodeBrix.Imaging.Drawing.ApacheLicenseForever@1.0.238.425
#addin nuget:?package=CodeBrix.Imaging.Drawing.ApacheLicenseForever&version=1.0.238.425
#tool nuget:?package=CodeBrix.Imaging.Drawing.ApacheLicenseForever&version=1.0.238.425
CodeBrix.Imaging.Drawing
A stroke-based drawing, painting and highlighting library for SkiaSharp canvases in .NET applications. CodeBrix.Imaging.Drawing captures pointer (mouse, pen, or touch) input as resolution-independent calibrated strokes on named, colored layers, renders them with translucent "highlighter" compositing over a background image — or over a transparent canvas above live content such as a webcam video feed — and exports finished drawings as PNG/JPEG images or CodeBrix.Imaging images. It works with any UI framework that can host a SkiaSharp drawing surface, including CodeBrix.Platform (all Skia heads), native WinUI 3, WPF, and .NET MAUI.
Both packages described below are .NET 10 libraries. The SkiaSharp-backed package, CodeBrix.Imaging.Drawing.ApacheLicenseForever, depends only on SkiaSharp and the CodeBrix.Imaging package; the managed CodeBrix.Imaging.Drawing.NoSkia.ApacheLicenseForever package has no SkiaSharp dependency at all.
This repository produces two NuGet packages that are either/or alternatives — never reference both from one application, because they compile the same drawing-session sources into the same namespaces:
CodeBrix.Imaging.Drawing.ApacheLicenseForever— the SkiaSharp-backed library described above. Choose it when you want Skia's rendering performance and the rest of the Skia surface alongside it.CodeBrix.Imaging.Drawing.NoSkia.ApacheLicenseForever— a completely managed companion with zero dependence on SkiaSharp or any native library: a managed workalike for the SkiaSharp drawing API, with no SkiaSharp dependency. It provides the identical drawing-session API (switching is a package swap; the SkiaSharp-typed touchpoints rename mechanicallySK*→Drawing*), a workalike 2D drawing engine (DrawingCanvas,DrawingBitmap,DrawingPaint,DrawingPath, gradients, pattern fills, blend modes, clipping, save-layers), and a fully managed SVG renderer (DrawingSvg: SVG → bitmap/PNG at any scale, with explicit font registration so output never depends on system fonts — plus the document's display list and read-only scene tree, for consumers that need to re-emit it as something other than pixels). Nothing it exposes is Skia-named; developers who prefer to keep writingSKCanvascan opt in to alias names with a singleCodeBrixUseSkiaTypeNamesproperty. Rendering is CPU-only and deliberately favors correctness and zero-dependency deployment over raw speed. Its only dependencies are the fully managedCodeBrix.Imaging.ApacheLicenseForeverandCodeBrix.SvgParse.MsplLicenseForeverpackages.
CodeBrix.Imaging.Drawing supports applications and assemblies that target Microsoft .NET version 10.0 and later. Microsoft .NET version 10.0 is a Long-Term Supported (LTS) version of .NET, and was released on Nov 11, 2025; and will be actively supported by Microsoft until Nov 14, 2028. Please update your C#/.NET code and projects to the latest LTS version of Microsoft .NET.
Installation
Reference one of the two packages - never both, since they declare the same types in the same namespaces:
dotnet add package CodeBrix.Imaging.Drawing.ApacheLicenseForever
dotnet add package CodeBrix.Imaging.Drawing.NoSkia.ApacheLicenseForever
Note that the NuGet package IDs and the namespaces are different - there is no package named plain CodeBrix.Imaging.Drawing:
- SkiaSharp-backed package ID:
CodeBrix.Imaging.Drawing.ApacheLicenseForever - Fully managed package ID:
CodeBrix.Imaging.Drawing.NoSkia.ApacheLicenseForever - Namespaces in both:
CodeBrix.Imaging.Drawingfor the drawing session andCodeBrix.Imaging.Drawing.ModelsforDrawingLayer,Strokeand the other model types
XML documentation (IntelliSense) ships alongside the assemblies in both packages.
CodeBrix.Imaging.Drawing supports:
- Interactive stroke drawing driven by simple pointer events (
PointerPressed/PointerMoved/PointerReleased) forwarded from any UI framework's canvas control - Resolution-independent stroke storage in a calibrated logical space, so drawings survive window resizing, DPI changes, and orientation flips
- Named, colored drawing layers (for example Pain / Numbness / Tingling) with translucent highlighter compositing — overlapping strokes within a layer never double-darken
- Annotating photos and images of any aspect ratio:
DrawingSession.CreateForImage(...)takes an explicit calibration size — or an explicitCalibrationSizing.DeriveFromBackgroundImagechoice that computes it from the image — and the parameterless export methods produce the annotated image at its original resolution with no distortion - Drawing over a background image (such as a black-and-white line diagram), over a solid fill, or over a fully transparent canvas above externally rendered content such as a live video frame
- Incremental rendering with per-layer bitmap caches, so live drawing stays fast at large stroke counts
- Programmatic drawing primitives — lines, arrows, circles, ellipses, rectangles, and polylines/polygons (outline or filled) — using plain coordinates and CodeBrix.Imaging colors, with no SkiaSharp knowledge required; ideal for computer-vision-driven annotation of a live video feed
- Clear, per-layer clear, and undo-last-stroke operations (shapes and strokes share one undo history)
- Export to PNG or JPEG bytes, to a SkiaSharp
SKImage, or to a CodeBrix.ImagingImage<Rgba32>for further processing
Sample Code
Drawing on a SkiaSharp canvas with highlighter layers
using CodeBrix.Imaging; // Color, Size
using CodeBrix.Imaging.Drawing; // DrawingSession
using CodeBrix.Imaging.Drawing.Models; // DrawingLayer
var session = new DrawingSession();
session.SetBackgroundImage(File.ReadAllBytes("body_map.png"));
session.BackgroundFillColor = Color.White;
DrawingLayer pain = session.AddLayer("Pain", Color.FromRgb(255, 30, 230));
DrawingLayer numbness = session.AddLayer("Numbness", Color.FromRgb(30, 128, 204));
session.ActiveLayer = pain;
// Hook the session to your UI framework's Skia canvas control:
session.RedrawRequested += (s, e) => canvasControl.Invalidate();
// In the control's PaintSurface handler:
// session.Render(e.Surface, e.Info);
// In the control's pointer handlers (left button):
// session.PointerPressed(point, viewSize); session.PointerMoved(point, viewSize); session.PointerReleased();
// Save the finished drawing:
byte[] png = session.ExportPng(new Size(1000, 1000));
File.WriteAllBytes("highlighted_body_map.png", png);
Annotating a photo (any aspect ratio)
using CodeBrix.Imaging; // Color, Size
using CodeBrix.Imaging.Drawing; // DrawingSession, CalibrationSizing
// You explicitly choose the calibrated drawing space: pass a size, or ask for it
// to be derived from the photo's aspect ratio
var session = DrawingSession.CreateForImage(
File.ReadAllBytes("car_photo.jpg"),
CalibrationSizing.DeriveFromBackgroundImage);
session.AddLayer("Damage", Color.Red);
// ...wire pointer events and PaintSurface as above, draw on the photo...
// Exports at the photo's original resolution, never distorted
File.WriteAllBytes("car_photo_annotated.png", session.ExportPng());
The samples above are written against the SkiaSharp-backed package. On the NoSkia package the same code compiles with the SkiaSharp-typed touchpoints renamed mechanically - SKSurface becomes DrawingSurface, SKImageInfo becomes DrawingImageInfo, SKPoint becomes DrawingPoint, SKSize becomes DrawingSize - or unchanged if you set <CodeBrixUseSkiaTypeNames>true</CodeBrixUseSkiaTypeNames> in the consuming project, which adds the Skia names as global using aliases.
The samples/PainDiagram folder of this repository contains a complete reference application that runs on every CodeBrix.Platform Skia head (Windows Win32 and WPF-hosted, Linux X11 / Wayland / framebuffer, macOS) plus native WinUI 3 and WPF heads, all sharing one view model.
Documentation
Each NuGet package includes an AGENT-README.txt - a complete API reference and usage guide written for AI coding agents, specific to the package you referenced. Point your agent at that file when it is writing code against this library.
Additional sample code and usage examples are available in the test projects: https://github.com/ellisnet/CodeBrix.Imaging.Drawing/tree/main/tests
License
The project is licensed under the Apache 2.0 License. see: https://en.wikipedia.org/wiki/Apache_License
THIRD-PARTY-NOTICES.txt, which ships inside both NuGet packages, records the SkiaSharp API-compatibility notice for the NoSkia workalike types, the vendored SVG pipeline used by CodeBrix.Imaging.Drawing.NoSkia.Svg, and the fonts used as test assets.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- CodeBrix.Imaging.ApacheLicenseForever (>= 1.0.238.393)
- SkiaSharp (>= 4.151.0)
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 |
|---|---|---|
| 1.0.238.425 | 0 | 8/26/2026 |
| 1.0.238.170 | 0 | 8/26/2026 |
| 1.0.214.1305 | 110 | 8/2/2026 |
| 1.0.213.59 | 99 | 8/1/2026 |
| 1.0.196.349 | 115 | 7/15/2026 |
| 1.0.195.341 | 105 | 7/14/2026 |
| 1.0.193.406 | 115 | 7/12/2026 |
| 1.0.185.1134 | 118 | 7/4/2026 |