Class SimulatedDisplayBase
Simulated displayRenderer base class, provides a virtual displayRenderer that renders to a real displayRenderer
Assembly: Meadow.Foundation.dll
View Source
public class SimulatedDisplayBase : IVirtualPixelDisplay, IPixelDisplay, IDisplay
Derived:
Expand
Meadow.Foundation.Displays.SimulatedEpd2in15g, Meadow.Foundation.Displays.SimulatedEpd5in65f, Meadow.Foundation.Displays.SimulatedGc9a01, Meadow.Foundation.Displays.SimulatedHx8357b, Meadow.Foundation.Displays.SimulatedHx8357d, Meadow.Foundation.Displays.SimulatedIl0373, Meadow.Foundation.Displays.SimulatedIl0376F, Meadow.Foundation.Displays.SimulatedIl0398, Meadow.Foundation.Displays.SimulatedIl3897, Meadow.Foundation.Displays.SimulatedIl91874, Meadow.Foundation.Displays.SimulatedIl91874V03, Meadow.Foundation.Displays.SimulatedIli9163, Meadow.Foundation.Displays.SimulatedIli9225, Meadow.Foundation.Displays.SimulatedIli9341, Meadow.Foundation.Displays.SimulatedIli9481, Meadow.Foundation.Displays.SimulatedIli9488, Meadow.Foundation.Displays.SimulatedRm68140, Meadow.Foundation.Displays.SimulatedS6D02A1, Meadow.Foundation.Displays.SimulatedSsd1331, Meadow.Foundation.Displays.SimulatedSsd1351, Meadow.Foundation.Displays.SimulatedSsd1608, Meadow.Foundation.Displays.SimulatedSsd1680, Meadow.Foundation.Displays.SimulatedSsd1681, Meadow.Foundation.Displays.SimulatedSt7735, Meadow.Foundation.Displays.SimulatedSt7789, Meadow.Foundation.Displays.SimulatedSt7796s, Meadow.Foundation.Displays.SimulatedUc8151c
Implements:
Meadow.Peripherals.Displays.IVirtualPixelDisplay, Meadow.Peripherals.Displays.IPixelDisplay, Meadow.Peripherals.Displays.IDisplay
Properties
IsRotated
Is the display rotated (swapped width and height)
View Source
public bool IsRotated { get; }
ColorMode
The currently set color mode for the display
View Source
public ColorMode ColorMode { get; }
SupportedColorModes
The Color mode supported by the display
View Source
public virtual ColorMode SupportedColorModes { get; protected set; }
Renderer
Gets the resizable pixel display renderer.
View Source
public virtual IPixelDisplay Renderer { get; }
Width
Width of the display in pixels
View Source
public int Width { get; }
Height
Height of the display in pixels
View Source
public int Height { get; }
EnabledColor
The enabled color for the displayRenderer
View Source
protected virtual Color EnabledColor { get; }
DisabledColor
The disabled color for the displayRenderer
View Source
protected virtual Color DisabledColor { get; }
PixelBuffer
Provide a buffer that matches this display's color depth, height, and width This should be the buffer that is sent to the device when Show is called
View Source
public IPixelBuffer PixelBuffer { get; }
Fields
pixelBufferDisplay
The pixel buffer for the displayRenderer
View Source
protected IPixelBuffer pixelBufferDisplay
pixelBufferSimulated
The bit-per-pixel accurate simulated display buffer
View Source
protected IPixelBuffer pixelBufferSimulated
displayRenderer
The real displayRenderer that renders that virtual displayRenderer is rendered on
View Source
protected IPixelDisplay displayRenderer
Methods
Clear(bool)
Clear the display
View Source
public void Clear(bool updateDisplay = false)
Parameters
| Type | Name | Description |
|---|---|---|
System.Boolean | updateDisplay | Update the display once the buffer has been cleared when true |
DrawPixel(int, int, Color)
Draw a single pixel at the specified color
View Source
public void DrawPixel(int x, int y, Color color)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | x position in pixels |
System.Int32 | y | y position in pixels |
Meadow.Color | color | The Meadow Foundation color of the pixel |
DrawPixel(int, int, bool)
Enable or disable a single pixel (used for 1bpp displays)
View Source
public void DrawPixel(int x, int y, bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | x position in pixels |
System.Int32 | y | y position in pixels |
System.Boolean | enabled | On if true, off if false |
Fill(Color, bool)
Clear the display
View Source
public void Fill(Color fillColor, bool updateDisplay = false)
Parameters
| Type | Name | Description |
|---|---|---|
Meadow.Color | fillColor | The color used to fill the display buffer |
System.Boolean | updateDisplay | Update the display once the buffer has been cleared when true |
Fill(int, int, int, int, Color)
Clear the display
View Source
public void Fill(int x, int y, int width, int height, Color fillColor)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | x position in pixels |
System.Int32 | y | y position in pixels |
System.Int32 | width | width to fill in pixels |
System.Int32 | height | height to fill in pixels |
Meadow.Color | fillColor | The color used to fill the display buffer |
InvertPixel(int, int)
Invert the color of a single pixel
View Source
public void InvertPixel(int x, int y)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | x position in pixels |
System.Int32 | y | y position in pixels |
Show()
Transfer the contents of the buffer to the display
View Source
public void Show()
Show(int, int, int, int)
Transfer part of the contents of the buffer to the display bounded by left, top, right and bottom
View Source
public void Show(int left, int top, int right, int bottom)
Parameters
| Type | Name |
|---|---|
System.Int32 | left |
System.Int32 | top |
System.Int32 | right |
System.Int32 | bottom |
WriteBuffer(int, int, IPixelBuffer)
Draw a buffer to the display
View Source
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
| Type | Name |
|---|---|
System.Int32 | x |
System.Int32 | y |
Meadow.Peripherals.Displays.IPixelBuffer | displayBuffer |
Implements
Meadow.Peripherals.Displays.IVirtualPixelDisplayMeadow.Peripherals.Displays.IPixelDisplayMeadow.Peripherals.Displays.IDisplay