OpenMacroBoard.SDK.KeyBitmap.GDI
11.0.0-beta.1
dotnet add package OpenMacroBoard.SDK.KeyBitmap.GDI --version 11.0.0-beta.1
NuGet\Install-Package OpenMacroBoard.SDK.KeyBitmap.GDI -Version 11.0.0-beta.1
<PackageReference Include="OpenMacroBoard.SDK.KeyBitmap.GDI" Version="11.0.0-beta.1" />
<PackageVersion Include="OpenMacroBoard.SDK.KeyBitmap.GDI" Version="11.0.0-beta.1" />
<PackageReference Include="OpenMacroBoard.SDK.KeyBitmap.GDI" />
paket add OpenMacroBoard.SDK.KeyBitmap.GDI --version 11.0.0-beta.1
#r "nuget: OpenMacroBoard.SDK.KeyBitmap.GDI, 11.0.0-beta.1"
#:package OpenMacroBoard.SDK.KeyBitmap.GDI@11.0.0-beta.1
#addin nuget:?package=OpenMacroBoard.SDK.KeyBitmap.GDI&version=11.0.0-beta.1&prerelease
#tool nuget:?package=OpenMacroBoard.SDK.KeyBitmap.GDI&version=11.0.0-beta.1&prerelease
OpenMacroBoard.SDK.KeyBitmap.GDI
Draw the images for the keys of a macro board with GDI+ (System.Drawing): text, lines,
shapes, everything Graphics offers. This package adds two methods to KeyBitmap.Create of
OpenMacroBoard.SDK.
Windows only, because System.Drawing itself only works on Windows.
Draw on a key
FromGraphics gives you a Graphics object of the size you ask for and turns what you drew
into a KeyBitmap.
using OpenMacroBoard.SDK;
using System.Drawing;
using var font = new Font("Arial", 20);
var key = KeyBitmap.Create.FromGraphics(72, 72, g =>
{
g.Clear(Color.DarkBlue);
g.DrawString("Hi!", font, Brushes.White, 10, 20);
});
board.SetKeyBitmap(0, key);
Use an existing bitmap
FromBitmap converts a System.Drawing.Bitmap you already have.
using var bitmap = new Bitmap("icon.png");
var key = KeyBitmap.Create.FromBitmap(bitmap);
The bitmap has to be in the pixel format Format24bppRgb or Format32bppArgb. Transparent
parts become black.
Do you need this package?
Not for loading image files. The SDK reads BMP, PNG and JPEG files on every platform:
var key = KeyBitmap.Create.FromFile("icon.png");
You need it when you want to draw at run time and GDI+ is your drawing library. For drawing on Linux and macOS too, see OpenMacroBoard.SDK.KeyBitmap.SkiaSharp.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- OpenMacroBoard.SDK (>= 11.0.0-beta.1)
- System.Drawing.Common (>= 10.0.9)
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 | 63 | 11/21/2026 |
| 10.0.0 | 274 | 6/19/2026 |
| 6.1.0 | 785 | 9/17/2025 |
| 6.0.0 | 1,205 | 3/3/2024 |