Skip to main content

Class SilkDisplay

Represents a pixel display using Silk.NET and OpenGL

Assembly: Meadow.Silk.dll​
View Source​
Declaration
public class SilkDisplay : IResizablePixelDisplay, IPixelDisplay, IDisplay, ITouchScreen

Implements:
Meadow.Peripherals.Displays.IResizablePixelDisplay, Meadow.Peripherals.Displays.IPixelDisplay, Meadow.Peripherals.Displays.IDisplay, Meadow.Hardware.ITouchScreen

Properties​

Rotation​

Gets the current rotation of the touchscreen

View Source​
Declaration
public RotationType Rotation { 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​
Declaration
public IPixelBuffer PixelBuffer { get; }

ColorMode​

The currently set color mode for the display

View Source​
Declaration
public ColorMode ColorMode { get; }

Width​

Width of the display in pixels

View Source​
Declaration
public int Width { get; }

Height​

Height of the display in pixels

View Source​
Declaration
public int Height { get; }

SupportedColorModes​

The Color mode supported by the display

View Source​
Declaration
public ColorMode SupportedColorModes { get; }

IsTouched​

Returns <b>true</b> if the touchscreen is currently being touched, otherwise <b>false</b>

View Source​
Declaration
public bool IsTouched { get; }

Methods​

Resize(int, int, float)​

Rsizes the display

View Source​
Declaration
public void Resize(int width, int height, float displayScale = 1)
Parameters​
TypeNameDescription
System.Int32widthThe new display width
System.Int32heightThe new display height
System.SingledisplayScaleThe new display height

Run()​

Run the application

View Source​
Declaration
public void Run()

Show()​

Performs a full display update

View Source​
Declaration
public void Show()

Show(int, int, int, int)​

Partial screen update

View Source​
Declaration
public void Show(int left, int top, int right, int bottom)
Parameters​
TypeName
System.Int32left
System.Int32top
System.Int32right
System.Int32bottom

Clear(bool)​

Clears the display buffer

View Source​
Declaration
public void Clear(bool updateDisplay = false)
Parameters​
TypeName
System.BooleanupdateDisplay

Fill(Color, bool)​

Fills the entire display with a given color

View Source​
Declaration
public void Fill(Color fillColor, bool updateDisplay = false)
Parameters​
TypeName
Meadow.ColorfillColor
System.BooleanupdateDisplay

Fill(int, int, int, int, Color)​

Fills a region with a given color

View Source​
Declaration
public void Fill(int x, int y, int width, int height, Color fillColor)
Parameters​
TypeName
System.Int32x
System.Int32y
System.Int32width
System.Int32height
Meadow.ColorfillColor

DrawPixel(int, int, Color)​

Fills a pixel with a given color

View Source​
Declaration
public void DrawPixel(int x, int y, Color color)
Parameters​
TypeName
System.Int32x
System.Int32y
Meadow.Colorcolor

DrawPixel(int, int, bool)​

Fills a pixel with either black or white

View Source​
Declaration
public void DrawPixel(int x, int y, bool colored)
Parameters​
TypeName
System.Int32x
System.Int32y
System.Booleancolored

InvertPixel(int, int)​

Inverts the pixel at the given location

View Source​
Declaration
public void InvertPixel(int x, int y)
Parameters​
TypeName
System.Int32x
System.Int32y

WriteBuffer(int, int, IPixelBuffer)​

Draws to the pixel buffer at a specified location

View Source​
Declaration
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters​
TypeName
System.Int32x
System.Int32y
Meadow.Peripherals.Displays.IPixelBufferdisplayBuffer

Events​

TouchDown​

Event raised when the touchscreen is pressed

View Source​
Declaration
public event TouchEventHandler TouchDown
Event Type​

Meadow.Hardware.TouchEventHandler

TouchUp​

Event raised when the touchscreen is released

View Source​
Declaration
public event TouchEventHandler TouchUp
Event Type​

Meadow.Hardware.TouchEventHandler

TouchClick​

Event raised when a cycle of press and release has occurred

View Source​
Declaration
public event TouchEventHandler TouchClick
Event Type​

Meadow.Hardware.TouchEventHandler

TouchMoved​

Event raised when a cycle of press and release has occurred

View Source​
Declaration
public event TouchEventHandler TouchMoved
Event Type​

Meadow.Hardware.TouchEventHandler

Implements​

  • Meadow.Peripherals.Displays.IResizablePixelDisplay
  • Meadow.Peripherals.Displays.IPixelDisplay
  • Meadow.Peripherals.Displays.IDisplay
  • Meadow.Hardware.ITouchScreen