Characteristic | Locus |
---|---|
Inheritance | object > GtkDisplay |
Implements | IGraphicsDisplay ITouchScreen |
Inherited Members | object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() |
Namespace | Meadow.Foundation.Displays |
Assembly | Gtk.dll |
Syntax
public class GtkDisplay : IGraphicsDisplay, ITouchScreen
Constructors
GtkDisplay(ColorMode)
Create a new GTK Display with a default size of 800x600
Declaration
public GtkDisplay(ColorMode mode = ColorMode.Format24bppRgb888)
Parameters
Type | Name | Description |
---|---|---|
ColorMode | mode | Color mode of the display |
GtkDisplay(int, int, ColorMode)
Create a new GTK Display
Declaration
public GtkDisplay(int width, int height, ColorMode mode = ColorMode.Format24bppRgb888)
Parameters
Type | Name | Description |
---|---|---|
int | width | Width of display in pixels |
int | height | Height of display in pixels |
ColorMode | mode | Color mode of the display |
Properties
ColorMode
Current color mode of display
Declaration
public ColorMode ColorMode { get; }
Property Value
Type | Description |
---|---|
ColorMode |
Height
Height of the display, in pixels
Declaration
public int Height { get; }
Property Value
Type | Description |
---|---|
int |
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
Declaration
public IPixelBuffer PixelBuffer { get; }
Property Value
Type | Description |
---|---|
IPixelBuffer |
SupportedColorModes
The color modes supported by the display
Declaration
public ColorMode SupportedColorModes { get; }
Property Value
Type | Description |
---|---|
ColorMode |
Width
Width of the display, in pixels
Declaration
public int Width { get; }
Property Value
Type | Description |
---|---|
int |
Methods
Clear(bool)
Clears the display buffer
Declaration
public void Clear(bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
bool | updateDisplay |
DrawPixel(int, int, Color)
Fills a pixel with a given color
Declaration
public void DrawPixel(int x, int y, Color color)
Parameters
Type | Name | Description |
---|---|---|
int | x | |
int | y | |
Color | color |
DrawPixel(int, int, bool)
Fills a pixel with either black or white
Declaration
public void DrawPixel(int x, int y, bool colored)
Parameters
Type | Name | Description |
---|---|---|
int | x | |
int | y | |
bool | colored |
Fill(Color, bool)
Fills the entire display with a given color
Declaration
public void Fill(Color fillColor, bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
Color | fillColor | |
bool | updateDisplay |
Fill(int, int, int, int, Color)
Fills a region with a given color
Declaration
public void Fill(int x, int y, int width, int height, Color fillColor)
Parameters
Type | Name | Description |
---|---|---|
int | x | |
int | y | |
int | width | |
int | height | |
Color | fillColor |
InvertPixel(int, int)
Inverts the pixel at the given location
Declaration
public void InvertPixel(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
int | x | |
int | y |
Run()
Run the application
Declaration
public void Run()
Show()
Performs a full display update
Declaration
public void Show()
Show(int, int, int, int)
Partial screen update
Declaration
public void Show(int left, int top, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
int | left | |
int | top | |
int | right | |
int | bottom |
WriteBuffer(int, int, IPixelBuffer)
Draws to the pixel buffer at a specified location
Declaration
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
Type | Name | Description |
---|---|---|
int | x | |
int | y | |
IPixelBuffer | displayBuffer |
Events
TouchClick
Event fired when the display gets a mouse click
Declaration
public event TouchEventHandler TouchClick
Event Type
Type | Description |
---|---|
TouchEventHandler |
TouchDown
Event fired when the display gets a mouse down
Declaration
public event TouchEventHandler TouchDown
Event Type
Type | Description |
---|---|
TouchEventHandler |
TouchUp
Event fired when the display gets a mouse up
Declaration
public event TouchEventHandler TouchUp
Event Type
Type | Description |
---|---|
TouchEventHandler |