private void ReleaseUnmanagedResources() { if (_matrix != IntPtr.Zero) { PiNativeMethods.DeleteMatrix(_matrix); } }
public PiRgbMatrix(int numCells) { Validate.Range(numCells, 1, 2); Width = 32 * numCells; Height = 32; _matrix = PiNativeMethods.CreateMatrix(Height, numCells); Clear(); }
public void SetWriteCycles(byte writeCycles) { PiNativeMethods.SetMatrixWriteCycles(_matrix, writeCycles); }
public void SetPwmBits(byte bits) { PiNativeMethods.SetMatrixPwmBits(_matrix, bits); }
public void SetPixel(int x, int y, RgbColor color) { Validate.XY(x, y, Width, Height); PiNativeMethods.SetMatrixPixel(_matrix, x, y, color.R, color.G, color.B); }
public void Fill(RgbColor color) { PiNativeMethods.FillMatrix(_matrix, color.R, color.G, color.B); }
public void Clear() { PiNativeMethods.ClearMatrix(_matrix); }