Skip to main content

DisplayCanvas

Namespace: Busy.Bar

Convenience helpers for positioning DisplayElements on the BUSY Bar's screen. Not part of the raw HTTP API — DisplayElement.Align only anchors an element's own bounding box at DisplayElement.X/DisplayElement.Y; it does not center the element within the canvas the way you might expect. Confirmed against physical hardware: left at the default X=0, Y=0, an ElementAlign.Center element gets its center pinned to the canvas's top-left corner, pushing roughly half of it off-screen. Use DisplayCanvas.AnchorFor(ElementAlign) to compute the correct X/Y for a given alignment against the canvas's own bounds.

public static class DisplayCanvas

Inheritance Object → DisplayCanvas

Fields​

Width​

Width, in pixels, of the standard BUSY Bar display (model BB.1 — the only model currently documented; revisit if a device with different dimensions ships).

public static int Width;

Height​

Height, in pixels, of the standard BUSY Bar display (model BB.1 — the only model currently documented; revisit if a device with different dimensions ships).

public static int Height;

Properties​

Center​

The canvas's own center point.

public static (int X, int Y) Center { get; }

Property Value​

(Int32, Int32)

Methods​

AnchorFor(ElementAlign)​

Returns the (X, Y) coordinate on the canvas that corresponds to the given alignment — e.g. ElementAlign.Center returns the canvas's exact center, ElementAlign.TopRight its top-right corner. Assign the result to a DisplayElement's DisplayElement.X/ DisplayElement.Y so the same alignment anchors it relative to the whole canvas rather than to the canvas's top-left corner.

public static (int X, int Y) AnchorFor(ElementAlign align)

Parameters​

align ElementAlign

Returns​

(Int32 X, Int32 Y)