Class BufferRgb565
Represents a 16bpp color pixel buffer
Assembly: MicroGraphics.dll
View Source
Declaration
public class BufferRgb565 : PixelBufferBase, IPixelBuffer, IDisposable
Inheritance: System.Object
-> Meadow.Foundation.Graphics.Buffers.PixelBufferBase
Implements:
Meadow.Peripherals.Displays.IPixelBuffer
, System.IDisposable
Properties
ColorMode
Color mode of the buffer
View Source
Declaration
public override ColorMode ColorMode { get; }
Methods
GetPixel16bpp(int, int)
Get the pixel color
View Source
Declaration
public ushort GetPixel16bpp(int x, int y)
Returns
System.UInt16
: The pixel color as a 565 16bpp value
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The X pixel position |
System.Int32 | y | The Y pixel position |
GetPixel(int, int)
Get the pixel color
View Source
Declaration
public override Color GetPixel(int x, int y)
Returns
Meadow.Color
: The pixel color
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The X pixel position |
System.Int32 | y | The Y pixel position |
SetPixel(int, int, ushort)
Set the pixel color
View Source
Declaration
public void SetPixel(int x, int y, ushort color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | X pixel position |
System.Int32 | y | Y pixel position |
System.UInt16 | color | The pixel color packed as a 565 16bpp ushort |
SetPixel(int, int, Color)
Set the pixel color
View Source
Declaration
public override void SetPixel(int x, int y, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | X pixel position |
System.Int32 | y | Y pixel position |
Meadow.Color | color | The pixel color |
Fill(Color)
Fill buffer with a color
View Source
Declaration
public override void Fill(Color color)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Color | color | The fill color |
Fill(int, int, int, int, Color)
Fill with a color
View Source
Declaration
public override void Fill(int x, int y, int width, int height, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | X start position in pixels |
System.Int32 | y | Y start position in pixels |
System.Int32 | width | Width in pixels |
System.Int32 | height | Height in pixels |
Meadow.Color | color | The fill color |
Exceptions
System.ArgumentOutOfRangeException
Throws an exception if fill area is beyond the buffer bounds
Clear(ushort)
Clear the buffer to a 565 16bpp color value
View Source
Declaration
public void Clear(ushort color)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | color | The color as a ushort |
InvertPixel(int, int)
Invert the pixel
View Source
Declaration
public override void InvertPixel(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | x position of pixel |
System.Int32 | y | y position of pixel |
WriteBuffer(int, int, IPixelBuffer)
Write a buffer to specific location to the current buffer
View Source
Declaration
public override void WriteBuffer(int x, int y, IPixelBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | x origin |
System.Int32 | y | y origin |
Meadow.Peripherals.Displays.IPixelBuffer | buffer | buffer to write |
Implements
Meadow.Peripherals.Displays.IPixelBuffer
System.IDisposable