Skip to main content

DisplayController Class

NuGet: GHIElectronics.TinyCLR.Devices.Display
Assembly: GHIElectronics.TinyCLR.Devices.Display
Namespace: GHIElectronics.TinyCLR.Devices.Display

Represents the framebuffer / panel controller. After supplying timing via SetConfiguration(DisplayControllerSettings) and calling Enable, push pixels with DrawBuffer / DrawPixel — or mount the controller into the higher-level drawing/UI stack via Hdc.

public class DisplayController : IDisposable

Properties​

Provider​

public IDisplayControllerProvider Provider { get; }

The low-level provider backing this controller.

Hdc​

public IntPtr Hdc { get; }

Native handle (HDC) for use with the drawing/UI stack.

ActiveConfiguration​

public DisplayControllerSettings ActiveConfiguration { get; set; }

The settings most recently applied via SetConfiguration(DisplayControllerSettings).

Methods​

GetDefault()​

public static DisplayController GetDefault()

Returns the default display controller for this device.

Returns DisplayController

FromName(string name)​

public static DisplayController FromName(string name)

Returns a display controller identified by its native API name.

Returns DisplayController

FromProvider(IDisplayControllerProvider provider)​

public static DisplayController FromProvider(IDisplayControllerProvider provider)

Creates a controller from a custom IDisplayControllerProvider.

Returns DisplayController

Dispose()​

public void Dispose()

Releases the underlying provider.

Enable()​

public void Enable()

Powers on the panel and the timing engine.

Disable()​

public void Disable()

Powers off the panel.

DrawBuffer(int targetX, int targetY, int sourceX, int sourceY, int width, int height, int originalWidth, byte[] data, int offset)​

public void DrawBuffer(int targetX, int targetY, int sourceX, int sourceY, int width, int height, int originalWidth, byte[] data, int offset)

Blits a rectangular region of an off-screen buffer to the panel.

ParameterTypeDescription
targetXintDestination left edge.
targetYintDestination top edge.
sourceXintSource-buffer left edge.
sourceYintSource-buffer top edge.
widthintWidth of the region in pixels.
heightintHeight of the region in pixels.
originalWidthintWidth of the full source buffer in pixels.
databyte[]Pixel data (RGB565 byte pairs).
offsetintStarting offset within data.

DrawPixel(int x, int y, long color)​

public void DrawPixel(int x, int y, long color)

Sets a single pixel.

ParameterTypeDescription
xintX coordinate.
yintY coordinate.
colorlongPixel color in the active DisplayDataFormat.

DrawString(string value)​

public void DrawString(string value)

Renders a string via the controller's built-in text mode (where supported).

SetConfiguration(DisplayControllerSettings configuration)​

public void SetConfiguration(DisplayControllerSettings configuration)

Applies a display configuration (timing, size, orientation, color format).

ParameterTypeDescription
configurationDisplayControllerSettingsA concrete settings instance — pass a ParallelDisplayControllerSettings for parallel RGB panels.