public virtual void DrawBitmap(ulong bitmap, Pixel colour, int panel = 0) { ulong mask; if (panel < 0 || panel >= NumberOfPanels) { return; } for (int pos = 0; pos < PixelsPerPanel; pos++) { mask = (ulong)1 << (int)pos; if ((bitmap & mask) == 0) { FrameSet(Colour.Black, (int)pos, panel); } else { FrameSet(colour, (int)pos, panel); } } }
public void DrawSymbol(Symbols[] sym, Pixel[] colour, int pause, int panel = 0) { ushort cycleColour = 0; foreach (var item in sym) { DrawBitmap((ulong)item, colour[cycleColour], panel); FrameDraw(); Util.Delay(pause); cycleColour++; } }
public void DrawSymbol(Symbols sym, Pixel colour, int panel = 0) { DrawBitmap((ulong)sym, colour, panel); }
public void DrawString(string characters, Pixel[] colour, int pause, int panel = 0) { ushort cycleColour = 0; char c; for (int i = 0; i < characters.Length; i++) { c = characters.Substring(i, 1)[0]; if (c >= ' ' && c <= 'z') { DrawLetter(c, colour[cycleColour % colour.Length], panel); FrameDraw(); Util.Delay(pause); cycleColour++; } } }
public void DrawLetter(char character, Pixel colour, int panel = 0) { ulong letter = 0; if (character >= ' ' && character <= 'z') { //calc ascii offset byte charValue = (byte)(character - 32); letter = fontSimple[charValue]; } else { return; } DrawBitmap(letter, colour, panel); }
public virtual void ScrollBitmapInFromLeft(ulong bitmap, int pause, Pixel colour) { int pos = 0; ulong mask; bool pixelFound = false; // space character ? if (bitmap == 0) { DrawShiftRight(pause); DrawShiftRight(pause); return; } // fetch vertical slice of character font for (int col = (int)ColumnsPerPanel - 1; col >= 0; col--) { pixelFound = false; for (int row = 0; row < RowsPerPanel; row++) { mask = 1UL << row * ColumnsPerPanel + col; pos = (int)ColumnsPerPanel * row; if ((bitmap & mask) != 0) { FrameSet(colour, pos, 0); pixelFound = true; } } if (pixelFound) { DrawShiftRight(pause); } } //blank character space DrawShiftRight(pause); }
public void DrawString(string characters, Pixel colour, int pause, int panel = 0) { DrawString(characters, new Pixel[] { colour }, pause, panel); }
public void ScrollSymbolInFromLeft(Symbols[] sym, int pause, Pixel colour) { foreach (var item in sym) { ScrollBitmapInFromLeft((ulong)item, pause, colour); } }
public void ScrollSymbolInFromLeft(Symbols[] sym, int pause, Pixel[] colourPalette) { ushort cycleColour = 0; foreach (var item in sym) { ScrollBitmapInFromLeft((ulong)item, pause, colourPalette[cycleColour % colourPalette.Length]); cycleColour++; } }
public void ScrollSymbolInFromLeft(Symbols sym, int pause, Pixel colour) { ScrollBitmapInFromLeft((ulong)sym, pause, colour); }
public void ScrollCharacterFromLeft(char charactor, int pause, Pixel colour) { if (charactor >= ' ' && charactor <= 'z') { ScrollBitmapInFromLeft(fontSimple[charactor - 32], pause, colour); } }
public void ScrollStringInFromLeft(string characters, int pause, Pixel[] colour) { ushort cycleColour = 0; // loop through each chacter for (int ch = characters.Length - 1; ch >= 0; ch--) { char charactor = characters.Substring(ch, 1)[0]; if (charactor >= ' ' && charactor <= 'z') { ScrollBitmapInFromLeft(fontSimple[charactor - 32], pause, colour[cycleColour % colour.Length]); cycleColour++; } } }
public void ScrollStringInFromLeft(string characters, int pause, Pixel colour) { ScrollStringInFromLeft(characters, pause, new Pixel[] { colour }); }
/// <summary> /// move a singel pixel around (or along) the ring (or strip) - always starts at position 0 /// </summary> /// <param name="pixelColour">Colour of the pixel to show</param> /// <param name="cycles">Number of whole cycles to rotate</param> /// <param name="stepDelay">Delay between steps (ms)</param> public Task SpinColour(Pixel pixelColour, int cycles = 1, int stepDelay = 250) { return(SpinColourOnBackground(pixelColour, Colour.Black, cycles, stepDelay)); }