Characteristic Locus
Inheritance object PixelBufferBase > Buffer1bpp > Buffer1bppV
Implements IPixelBuffer
Inherited Members PixelBufferBase.Width PixelBufferBase.Height PixelBufferBase.BitDepth PixelBufferBase.ByteCount PixelBufferBase.Buffer PixelBufferBase.InitializeBuffer(bool) PixelBufferBase.Clear() PixelBufferBase.WriteBufferSlow(int, int, IPixelBuffer) PixelBufferBase.RotateAndConvert<T>(RotationType) PixelBufferBase.ScaleUp<T>(int) PixelBufferBase.ConvertPixelBuffer<T>() PixelBufferBase.GetColorDistance(Color, Color) object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Graphics.Buffers
Assembly MicroGraphics.dll

Syntax

public class Buffer1bpp : PixelBufferBase, IPixelBuffer

Constructors

Buffer1bpp()

Creates a new empty Buffer1bpp object

Declaration
public Buffer1bpp()

Buffer1bpp(int, int)

Creates a new Buffer1bpp object

Declaration
public Buffer1bpp(int width, int height)

Parameters

Type Name Description
int width

width of buffer in pixels

int height

height of buffer in pixels

Buffer1bpp(int, int, byte[])

Creates a new Buffer1bpp object

Declaration
public Buffer1bpp(int width, int height, byte[] buffer)

Parameters

Type Name Description
int width

width of buffer in pixels

int height

height of buffer in pixels

byte[] buffer

data to copy into buffer

Buffer1bpp(int, int, int)

Creates a new Buffer1bpp object

Declaration
public Buffer1bpp(int width, int height, int pageSize)

Parameters

Type Name Description
int width

width of buffer in pixels

int height

height of buffer in pixels

int pageSize

the display page size, this will pad the total buffer size to multiples of the page size

Properties

ColorMode

Color mode of the buffer - 1 bit per pixel

Declaration
public override ColorMode ColorMode { get; }

Property Value

Type Description
ColorMode

Overrides

Methods

Clear(bool)

Clear the display

Declaration
public void Clear(bool enabled)

Parameters

Type Name Description
bool enabled

should the display pixels be enabled / on or clear / off

Fill(Color)

Fill the buffer with a color

Declaration
public override void Fill(Color color)

Parameters

Type Name Description
Color color

the fill color - will snap to black or white (on/off)

Overrides

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

Fill the buffer with a color

Declaration
public override void Fill(int x, int y, int width, int height, Color color)

Parameters

Type Name Description
int x

The x position in pixels

int y

The y position in pixels

int width

Width to fill in pixels

int height

Height to fill in pixels

Color color

The color to fill

Overrides

Exceptions

Type Condition
ArgumentOutOfRangeException

Throws an exception if the fill region is outside of the buffer

GetPixel(int, int)

Get the pixel color

Declaration
public override Color GetPixel(int x, int y)

Parameters

Type Name Description
int x

x location of pixel

int y

y location of pixel

Returns

Type Description
Color

The pixel color as a Color object - will be black or white only

Overrides

GetPixelIsEnabled(int, int)

Is the pixel on / enabled for a given location

Declaration
public virtual bool GetPixelIsEnabled(int x, int y)

Parameters

Type Name Description
int x

x location in pixels

int y

y location in pixels

Returns

Type Description
bool

true if pixel is set / enabled

InvertPixel(int, int)

Invert a pixel

Declaration
public override void InvertPixel(int x, int y)

Parameters

Type Name Description
int x

x position of pixel

int y

y position of pixel

Overrides

SetPixel(int, int, Color)

Set a pixel in the display buffer

Declaration
public override void SetPixel(int x, int y, Color color)

Parameters

Type Name Description
int x

x position in pixels from left

int y

y position in pixels from top

Color color

the color of the pixel - will snap to black or white (on/off)

Overrides

SetPixel(int, int, bool)

Set a pixel in the display buffer

Declaration
public virtual void SetPixel(int x, int y, bool enabled)

Parameters

Type Name Description
int x

x position in pixels from left

int y

y position in pixels from top

bool enabled

is pixel enabled (on)

WriteBuffer(int, int, IPixelBuffer)

Write a buffer to specific location to the current buffer

Declaration
public override void WriteBuffer(int x, int y, IPixelBuffer buffer)

Parameters

Type Name Description
int x

x origin

int y

y origin

IPixelBuffer buffer

buffer to write

Overrides