OpenMacroBoard.SDK.KeyBitmap.SkiaSharp
11.0.0-beta.1
dotnet add package OpenMacroBoard.SDK.KeyBitmap.SkiaSharp --version 11.0.0-beta.1
NuGet\Install-Package OpenMacroBoard.SDK.KeyBitmap.SkiaSharp -Version 11.0.0-beta.1
<PackageReference Include="OpenMacroBoard.SDK.KeyBitmap.SkiaSharp" Version="11.0.0-beta.1" />
<PackageVersion Include="OpenMacroBoard.SDK.KeyBitmap.SkiaSharp" Version="11.0.0-beta.1" />
<PackageReference Include="OpenMacroBoard.SDK.KeyBitmap.SkiaSharp" />
paket add OpenMacroBoard.SDK.KeyBitmap.SkiaSharp --version 11.0.0-beta.1
#r "nuget: OpenMacroBoard.SDK.KeyBitmap.SkiaSharp, 11.0.0-beta.1"
#:package OpenMacroBoard.SDK.KeyBitmap.SkiaSharp@11.0.0-beta.1
#addin nuget:?package=OpenMacroBoard.SDK.KeyBitmap.SkiaSharp&version=11.0.0-beta.1&prerelease
#tool nuget:?package=OpenMacroBoard.SDK.KeyBitmap.SkiaSharp&version=11.0.0-beta.1&prerelease
OpenMacroBoard.SDK.KeyBitmap.SkiaSharp
Draw the images for the keys of a macro board with SkiaSharp:
text, lines, shapes, everything an SKCanvas offers. This package adds two methods to
KeyBitmap.Create of OpenMacroBoard.SDK.
It works on Windows, Linux and macOS.
Draw on a key
FromSkiaCanvas gives you a canvas of the size you ask for and turns what you drew into a
KeyBitmap. The canvas starts black.
using OpenMacroBoard.SDK;
using SkiaSharp;
using var font = new SKFont(SKTypeface.Default, 24);
using var paint = new SKPaint { Color = SKColors.White, IsAntialias = true };
var key = KeyBitmap.Create.FromSkiaCanvas(72, 72, canvas =>
{
canvas.Clear(SKColors.DarkBlue);
canvas.DrawText("Hi!", 14, 44, SKTextAlign.Left, font, paint);
});
board.SetKeyBitmap(0, key);
Use an existing bitmap
FromSkiaBitmap converts an SKBitmap you already have, in any color type. Transparent
parts become black.
using var bitmap = SKBitmap.Decode("icon.webp");
var key = KeyBitmap.Create.FromSkiaBitmap(bitmap);
Linux
SkiaSharp needs a native library. For Windows and macOS it comes with SkiaSharp itself. On Linux, add one of these packages to your application:
SkiaSharp.NativeAssets.Linux.NoDependencies: needs no other library from the system. This is the simple choice, and what the examples in the repository use.SkiaSharp.NativeAssets.Linux: finds fonts through the librarylibfontconfig, which has to be installed on the system. Without it SkiaSharp does not start at all.
Both find the fonts that are installed on the system. A system without any font (many
containers) draws no text; install a font package, or load a font file with
SKTypeface.FromFile.
Do you need this package?
Not for loading image files. The SDK reads BMP, PNG and JPEG files itself:
var key = KeyBitmap.Create.FromFile("icon.png");
You need it when you want to draw at run time, for example text. On Windows only,
OpenMacroBoard.SDK.KeyBitmap.GDI does the same with
System.Drawing.
| 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
- OpenMacroBoard.SDK (>= 11.0.0-beta.1)
- SkiaSharp (>= 4.157.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 |
|---|---|---|
| 11.0.0-beta.1 | 60 | 11/21/2026 |