BitmapFont<T>

Models & Types · AiDotNet.ComputerVision.Visualization

A simple 5x7 bitmap font for rendering text on images.

For Beginners

This class provides a way to draw text on images without requiring external font libraries. Each character is defined as a 5-wide by 7-tall grid of pixels.

Constructors

Constructor Summary
BitmapFont() Creates a new bitmap font instance.

Methods

Method Summary
int MeasureWidth(string text) Measures the width of a text string in pixels.
void DrawText(Tensor<T> image, string text, int x, int y, ValueTuple<double, double, double> color, int scale) Draws text on an image at the specified position.
void DrawTextWithBackground(Tensor<T> image, string text, int x, int y, ValueTuple<double, double, double> textColor, ValueTuple<double, double, double> bgColor, int scale, int padding) Draws text with a background box.

Fields

Field Summary
int CharHeight Character height in pixels.
int CharSpacing Horizontal spacing between characters.
int CharWidth Character width in pixels.