OpenMacroBoard.SDK.KeyBitmap.GDI 11.0.0-beta.1

This is a prerelease version of OpenMacroBoard.SDK.KeyBitmap.GDI.
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
                    
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="OpenMacroBoard.SDK.KeyBitmap.GDI" Version="11.0.0-beta.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenMacroBoard.SDK.KeyBitmap.GDI" Version="11.0.0-beta.1" />
                    
Directory.Packages.props
<PackageReference Include="OpenMacroBoard.SDK.KeyBitmap.GDI" />
                    
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 OpenMacroBoard.SDK.KeyBitmap.GDI --version 11.0.0-beta.1
                    
#r "nuget: OpenMacroBoard.SDK.KeyBitmap.GDI, 11.0.0-beta.1"
                    
#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 OpenMacroBoard.SDK.KeyBitmap.GDI@11.0.0-beta.1
                    
#: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=OpenMacroBoard.SDK.KeyBitmap.GDI&version=11.0.0-beta.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=OpenMacroBoard.SDK.KeyBitmap.GDI&version=11.0.0-beta.1&prerelease
                    
Install as a Cake Tool

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 Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
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
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