Beispiel #1
0
 private void ReleaseUnmanagedResources()
 {
     if (_matrix != IntPtr.Zero)
     {
         PiNativeMethods.DeleteMatrix(_matrix);
     }
 }
Beispiel #2
0
        public PiRgbMatrix(int numCells)
        {
            Validate.Range(numCells, 1, 2);

            Width  = 32 * numCells;
            Height = 32;

            _matrix = PiNativeMethods.CreateMatrix(Height, numCells);

            Clear();
        }
Beispiel #3
0
 public void SetWriteCycles(byte writeCycles)
 {
     PiNativeMethods.SetMatrixWriteCycles(_matrix, writeCycles);
 }
Beispiel #4
0
 public void SetPwmBits(byte bits)
 {
     PiNativeMethods.SetMatrixPwmBits(_matrix, bits);
 }
Beispiel #5
0
        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);
        }
Beispiel #6
0
 public void Fill(RgbColor color)
 {
     PiNativeMethods.FillMatrix(_matrix, color.R, color.G, color.B);
 }
Beispiel #7
0
 public void Clear()
 {
     PiNativeMethods.ClearMatrix(_matrix);
 }