Class GtkDisplay
Represents a GTK graphics display
Assembly: Gtk.dll
View Source
public class GtkDisplay : 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
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
public IPixelBuffer PixelBuffer { get; }
ColorMode
The currently set color mode for the display
View Source
public ColorMode ColorMode { 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; }
SupportedColorModes
The Color mode supported by the display
View Source
public ColorMode SupportedColorModes { get; }
IsTouched
Returns <b>true</b> if the touchscreen is currently being touched, otherwise <b>false</b>
View Source
public bool IsTouched { get; }
Methods
Resize(int, int, float)
Rsizes the display
View Source
public void Resize(int width, int height, float displayScale = 1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | The new display width |
System.Int32 | height | The new display height |
System.Single | displayScale | The new display height |
Run()
Run the application
View Source
public void Run()
Show()
Performs a full display update
View Source
public void Show()
Show(int, int, int, int)
Partial screen update
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 |
Clear(bool)
Clears the display buffer
View Source
public void Clear(bool updateDisplay = false)
Parameters
Type | Name |
---|---|
System.Boolean | updateDisplay |
Fill(Color, bool)
Fills the entire display with a given color
View Source
public void Fill(Color fillColor, bool updateDisplay = false)
Parameters
Type | Name |
---|---|
Meadow.Color | fillColor |
System.Boolean | updateDisplay |
Fill(int, int, int, int, Color)
Fills a region with a given color
View Source
public void Fill(int x, int y, int width, int height, Color fillColor)
Parameters
Type | Name |
---|---|
System.Int32 | x |
System.Int32 | y |
System.Int32 | width |
System.Int32 | height |
Meadow.Color | fillColor |
DrawPixel(int, int, Color)
Fills a pixel with a given color
View Source
public void DrawPixel(int x, int y, Color color)
Parameters
Type | Name |
---|---|
System.Int32 | x |
System.Int32 | y |
Meadow.Color | color |
DrawPixel(int, int, bool)
Fills a pixel with either black or white
View Source
public void DrawPixel(int x, int y, bool colored)
Parameters
Type | Name |
---|---|
System.Int32 | x |
System.Int32 | y |
System.Boolean | colored |
InvertPixel(int, int)
Inverts the pixel at the given location
View Source
public void InvertPixel(int x, int y)
Parameters
Type | Name |
---|---|
System.Int32 | x |
System.Int32 | y |
WriteBuffer(int, int, IPixelBuffer)
Draws to the pixel buffer at a specified location
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 |
Events
TouchDown
Event raised when the touchscreen is pressed
View Source
public event TouchEventHandler TouchDown
Event Type
Meadow.Hardware.TouchEventHandler
TouchUp
Event raised when the touchscreen is released
View Source
public event TouchEventHandler TouchUp
Event Type
Meadow.Hardware.TouchEventHandler
TouchClick
Event raised when a cycle of press and release has occurred
View Source
public event TouchEventHandler TouchClick
Event Type
Meadow.Hardware.TouchEventHandler
TouchMoved
Event raised when a cycle of press and release has occurred
View Source
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