Class EPaperTriColorBase
Provide an interface for ePaper 3 color displays
Assembly: EPaper.dll
View Source
public abstract class EPaperTriColorBase : EPaperBase, ISpiPeripheral, IDisposable, IGraphicsDisplay
Inheritance: System.Object -> Meadow.Foundation.Displays.EPaperBase
Derived:
Meadow.Foundation.Displays.Epd4in2bV2, Meadow.Foundation.Displays.Il0373, Meadow.Foundation.Displays.Il0376F, Meadow.Foundation.Displays.Il0398, Meadow.Foundation.Displays.Il91874, Meadow.Foundation.Displays.Ssd1680, Meadow.Foundation.Displays.Ssd1681, Meadow.Foundation.Displays.Uc8151c
Implements:
Meadow.Hardware.ISpiPeripheral, System.IDisposable, Meadow.Foundation.Graphics.IGraphicsDisplay
Properties
EnabledColor
The color to draw when a pixel is enabled
View Source
public Color EnabledColor { get; }
DisabledColor
The color to draw when a pixel is disabled
View Source
public Color DisabledColor { get; }
IsBlackInverted
Is the black pixel data inverted
View Source
protected abstract bool IsBlackInverted { get; }
IsColorInverted
Is the color pixel data inverted
View Source
protected abstract bool IsColorInverted { get; }
ColorMode
Display color mode
View Source
public ColorMode ColorMode { get; }
SupportedColorModes
The Color mode supported by the display
View Source
public ColorMode SupportedColorModes { get; }
Width
Width of display in pixels
View Source
public virtual int Width { get; }
Height
Height of display in pixels
View Source
public virtual int Height { get; }
PixelBuffer
The pixel buffer - not directly accessible Use buffer.BlackBuffer and buffer.ColorBuffer to access byte arrays
View Source
public IPixelBuffer PixelBuffer { get; }
Fields
imageBuffer
The buffer the holds the black pixel data for the display
View Source
protected Buffer2bppEPaper imageBuffer
Methods
CreateBuffer(int, int)
Create an offscreen buffer for the display
View Source
protected virtual void CreateBuffer(int width, int height)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | width | The width in pixels |
System.Int32 | height | The height in pixels |
Initialize()
Initialize the display
View Source
protected abstract void Initialize()
Clear(bool)
Clear the display buffer
View Source
public void Clear(bool updateDisplay = false)
Parameters
| Type | Name | Description |
|---|---|---|
System.Boolean | updateDisplay | Update the display if true |
Fill(Color, bool)
Fill the display buffer with a color
View Source
public void Fill(Color color, bool updateDisplay = false)
Parameters
| Type | Name | Description |
|---|---|---|
Meadow.Color | color | The color - normalized to black, white or color |
System.Boolean | updateDisplay | Refresh the display if true |
Fill(int, int, int, int, Color)
Fill a region of the display buffer with a color
View Source
public void Fill(int x, int y, int width, int height, Color color)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | The x location |
System.Int32 | y | The y location |
System.Int32 | width | The width to fill in pixels |
System.Int32 | height | The height to fill in pixels |
Meadow.Color | color | The color to fill - normalized to black, white or color |
Clear(bool, bool)
Clear the display buffer
View Source
public void Clear(bool enabled, bool updateDisplay = false)
Parameters
| Type | Name | Description |
|---|---|---|
System.Boolean | enabled | If true, fill with the enabled color (default is white) |
System.Boolean | updateDisplay | If true, refresh the display |
DrawPixel(int, int, bool)
Draw a pixel
View Source
public void DrawPixel(int x, int y, bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | The x location in pixels |
System.Int32 | y | The y location in pixels |
System.Boolean | enabled | If true, use the enabled color (default is white) |
DrawBlackPixel(int, int, bool)
Draw a black pixel
View Source
public void DrawBlackPixel(int x, int y, bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | The x location in pixels |
System.Int32 | y | The y location in pixels |
System.Boolean | enabled | If true, use the enabled color (default is white) |
InvertPixel(int, int)
Invert a pixel
View Source
public void InvertPixel(int x, int y)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | The x location in pixels |
System.Int32 | y | The y location in pixels |
DrawColoredPixel(int, int, bool)
Set a colored pixel (on or off)
View Source
public void DrawColoredPixel(int x, int y, bool isOn)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | The x pixel location |
System.Int32 | y | The y pixel location |
System.Boolean | isOn | True for on, false for off |
DrawPixel(int, int, Color)
Draw a pixel
View Source
public void DrawPixel(int x, int y, Color color)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | The x pixel location |
System.Int32 | y | The y pixel location |
Meadow.Color | color | The pixel color |
WriteBuffer(int, int, IPixelBuffer)
Write a buffer to the display buffer
View Source
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | x | The x position in pixels to write the buffer |
System.Int32 | y | The y position in pixels to write the buffer |
| Meadow.Foundation.Graphics.Buffers.IPixelBuffer | displayBuffer | The buffer to write |
SendCommand(Command)
Send a command to the display
View Source
protected void SendCommand(EPaperTriColorBase.Command command)
Parameters
| Type | Name | Description |
|---|---|---|
| Meadow.Foundation.Displays.EPaperTriColorBase.Command | command | The command |
Show()
Update the display
View Source
public virtual void Show()
Exceptions
System.NotImplementedException
Show(int, int, int, int)
Update a region of the display from the offscreen buffer
View Source
public virtual void Show(int left, int top, int right, int bottom)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | left | Left bounds in pixels |
System.Int32 | top | Top bounds in pixels |
System.Int32 | right | Right bounds in pixels |
System.Int32 | bottom | Bottom bounds in pixels |
Implements
Meadow.Hardware.ISpiPeripheralSystem.IDisposable- Meadow.Foundation.Graphics.IGraphicsDisplay