Skip to main content

Class Buffer1bpp

Represents a 1bpp pixel buffer with horizontal pixel packing 1 byte represents 8 pixels on the x-axis

Assembly: MicroGraphics.dll
View Source
Declaration
public class Buffer1bpp : PixelBufferBase, IPixelBuffer, IDisposable

Inheritance: System.Object -> Meadow.Foundation.Graphics.Buffers.PixelBufferBase

Derived:
Meadow.Foundation.Graphics.Buffers.Buffer1bppV

Implements:
Meadow.Peripherals.Displays.IPixelBuffer, System.IDisposable

Properties

ColorMode

Color mode of the buffer - 1 bit per pixel

View Source
Declaration
public override ColorMode ColorMode { get; }

Methods

GetPixelIsEnabled(int, int)

Is the pixel on / enabled for a given location

View Source
Declaration
public virtual bool GetPixelIsEnabled(int x, int y)
Returns

System.Boolean: true if pixel is set / enabled

Parameters
TypeNameDescription
System.Int32xx location in pixels
System.Int32yy location in pixels

GetPixel(int, int)

Get the pixel color

View Source
Declaration
public override Color GetPixel(int x, int y)
Returns

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

Parameters
TypeNameDescription
System.Int32xx location of pixel
System.Int32yy location of pixel

SetPixel(int, int, bool)

Set a pixel in the display buffer

View Source
Declaration
public virtual void SetPixel(int x, int y, bool enabled)
Parameters
TypeNameDescription
System.Int32xx position in pixels from left
System.Int32yy position in pixels from top
System.Booleanenabledis pixel enabled (on)

SetPixel(int, int, Color)

Set a pixel in the display buffer

View Source
Declaration
public override void SetPixel(int x, int y, Color color)
Parameters
TypeNameDescription
System.Int32xx position in pixels from left
System.Int32yy position in pixels from top
Meadow.Colorcolorthe color of the pixel - will snap to black or white (on/off)

Fill(Color)

Fill the buffer with a color

View Source
Declaration
public override void Fill(Color color)
Parameters
TypeNameDescription
Meadow.Colorcolorthe fill color - will snap to black or white (on/off)

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

Fill the buffer with a color

View Source
Declaration
public override void Fill(int x, int y, int width, int height, Color color)
Parameters
TypeNameDescription
System.Int32xThe x position in pixels
System.Int32yThe y position in pixels
System.Int32widthWidth to fill in pixels
System.Int32heightHeight to fill in pixels
Meadow.ColorcolorThe color to fill
Exceptions

System.ArgumentOutOfRangeException
Throws an exception if the fill region is outside of the buffer

Clear(bool)

Clear the display

View Source
Declaration
public void Clear(bool enabled)
Parameters
TypeNameDescription
System.Booleanenabledshould the display pixels be enabled / on or clear / off

InvertPixel(int, int)

Invert a pixel

View Source
Declaration
public override void InvertPixel(int x, int y)
Parameters
TypeNameDescription
System.Int32xx position of pixel
System.Int32yy 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
TypeNameDescription
System.Int32xx origin
System.Int32yy origin
Meadow.Peripherals.Displays.IPixelBufferbufferbuffer to write

Implements

  • Meadow.Peripherals.Displays.IPixelBuffer
  • System.IDisposable