public static void UpdateMouseState(bool activeMouse) { GT.Color colorMouse = activeMouse ? GT.Color.Green : GT.Color.Red; display.SimpleGraphics.DisplayRectangle(GT.Color.Black, 0, GT.Color.Black, 240, 225, 15, 15); display.SimpleGraphics.DisplayText("XY", Resources.GetFont(Resources.FontResources.NinaB), colorMouse, 240, 225); display.SimpleGraphics.Redraw(); }
public static void UpdateSDState(bool activeSD) { GT.Color colorSD = activeSD ? GT.Color.Green : GT.Color.Red; display.SimpleGraphics.DisplayRectangle(GT.Color.Black, 0, GT.Color.Black, 300, 225, 20, 20); display.SimpleGraphics.DisplayText("SD", Resources.GetFont(Resources.FontResources.NinaB), colorSD, 300, 225); display.SimpleGraphics.Redraw(); }
public static void UpdateTPHState(bool activeTPH) { GT.Color colorTPH = activeTPH ? GT.Color.Green : GT.Color.Red; display.SimpleGraphics.DisplayRectangle(GT.Color.Black, 0, GT.Color.Black, 265, 225, 35, 35); display.SimpleGraphics.DisplayText("TPH", Resources.GetFont(Resources.FontResources.NinaB), colorTPH, 265, 225); display.SimpleGraphics.Redraw(); }
public static void UpdateMqttStatus(bool active) { GT.Color color = active ? GT.Color.Green : GT.Color.Red; display.SimpleGraphics.DisplayRectangle(GT.Color.Black, 0, GT.Color.Black, 305, 0, 15, 15); display.SimpleGraphics.DisplayText("M", Resources.GetFont(Resources.FontResources.NinaB), color, 305, 0); display.SimpleGraphics.Redraw(); }
public static void UpdateTimeStatus(bool synchronized) { GT.Color color = synchronized ? GT.Color.Green : GT.Color.Red; display.SimpleGraphics.DisplayRectangle(GT.Color.Black, 0, GT.Color.Black, 265, 0, 25, 25); display.SimpleGraphics.DisplayText("TS", Resources.GetFont(Resources.FontResources.NinaB), color, 265, 0); display.SimpleGraphics.Redraw(); }
public void displayText(string msg, GT.Color color) { var font = Resources.GetFont(Resources.FontResources.small); display_T35.SimpleGraphics.DisplayText(msg, font, color, 4, step); step += 12; }
/// <summary> /// Sets the color of the specified pixels on the <see cref="StarBoard"/>, based on RGB values. /// </summary> /// <param name="pixelNumStart">The number of the first pixel to set. Must be from 1 to 13.</param> /// <param name="pixelNumEnd">The number of the last pixel to set. Must be from 1 to 13 and greater than pixelNumStart.</param> /// <param name="color">GT.Color value to set.</param> public void SetPixels(int pixelNumStart, int pixelNumEnd, GT.Color color) { for (int i = pixelNumStart - 1; i < pixelNumEnd; i++) { MyWS2811Strip.Set(i, color.R, color.G, color.B); } MyWS2811Strip.Transmit(); }
public static bool ExtractComparableFactor(GT.Color pixel, byte threshold) { // byte values range 0..255 // byte is enough - single color value range 0..255 byte grayScale = GetGrayScaleFromPixel(pixel); return(GetThresholdedGrayscaleFactor(grayScale, threshold)); }
GT.Color getRandomColor() { var colors = new GT.Color[] { GT.Color.Red, GT.Color.Green, GT.Color.Blue, GT.Color.Yellow, GT.Color.Orange, GT.Color.Purple, GT.Color.Cyan, GT.Color.Magenta }; Random rnd = new Random(); var pilih = colors[rnd.Next(colors.Length)]; return(pilih); }
public Border AddStatusBar(UIElement element, int height, GT.Color startColor, GT.Color endColor) { Brush backgroundBrush = null; if (startColor == endColor) { backgroundBrush = new SolidColorBrush(startColor); } else { backgroundBrush = new LinearGradientBrush(startColor, endColor); } return(AddStatusBar(element, height, backgroundBrush)); }
// Setting different brush types depending on the color for backgroud public Border SetTitle(string title, Font font, GT.Color foreColor, GT.Color startColor, GT.Color endColor) { Brush backgroundBrush = null; if (startColor == endColor) { backgroundBrush = new SolidColorBrush(startColor); } else { backgroundBrush = new LinearGradientBrush(startColor, endColor); } return(SetTitle(title, font, foreColor, backgroundBrush)); }
private void displayOutline(Padding padding) { GT.Color lineColor = GT.Color.Red; uint thickness = 2; ushort fillOpacity = 0; display.SimpleGraphics.DisplayRectangle( lineColor, thickness, GT.Color.Black, (uint)padding.Left, (uint)padding.Top, (uint)(display.Width - padding.Left - padding.Right), (uint)(display.Height - padding.Top - padding.Bottom), fillOpacity ); }
// Setting the main title public Border SetTitle(string title, Font font, GT.Color foreColor, Brush backgroundBrush) { Border titleBar = new Border(); titleBar.Width = width; titleBar.Height = height; titleBar.Background = backgroundBrush; Text text = new Text(font, title); text.Width = width; text.ForeColor = foreColor; text.SetMargin(5); titleBar.Child = text; AddElement(titleBar, 0, 0); return(titleBar); }
public Border AddTitleBar(string title, Font font, GT.Color foreColor, Brush backgroundBrush) { Border titleBar = new Border(); titleBar.Width = displayWidth; titleBar.Height = titlebarHeight; titleBar.Background = backgroundBrush; Text text = new Text(font, title); text.Width = displayWidth; text.ForeColor = foreColor; text.SetMargin(marginSize); text.TextAlignment = TextAlignment.Left; titleBar.Child = text; AddChild(titleBar); return(titleBar); }
/// <summary> /// Sets the color of the specified pixel on the <see cref="StarBoard"/>, based on a GT.Color value. /// </summary> /// <param name="pixelNum">The number of the pixel to set. Must be from 1 to 13.</param> /// <param name="color">GT.Color value to set.</param> public void SetPixel(int pixelNum, GT.Color color) { MyWS2811Strip.Set(pixelNum - 1, color.R, color.G, color.B); MyWS2811Strip.Transmit(); }
public Border AddStatusBar(UIElement element, GT.Color startColor, GT.Color endColor) { return(AddStatusBar(element, height, startColor, endColor)); }
public Border AddStatusBar(UIElement element, int height, GT.Color backgroundColor) { return(AddStatusBar(element, height, backgroundColor, backgroundColor)); }
private void displayMatch(string text, GT.Color color) { display.SimpleGraphics.DisplayRectangle(GT.Color.White, 0, color, 0, 200, 320, 40); display.SimpleGraphics.DisplayText(text, fontArial18, GT.Color.White, 40, 208); }
// Factors by RGB to Gray-Scale conversion // From OpenCV's cvtColor method following ITU-R Recomendation BT.601 standard. // GRAYSCALE_RED_FACTOR: 0.299 // GRAYSCALE_GREEN_FACTOR: 0.587 // GRAYSCALE_BLUE_FACTOR: 0.114B // Equation: GrayScale = RedValue * GRAYSCALE_RED_FACTOR + GreenValue * GRAYSCALE_GREEN_FACTOR + BlueValue * GRAYSCALE_BLUE_FACTOR; public static byte GetGrayScaleFromPixel(GT.Color pixel) { return((byte)(pixel.R * GRAYSCALE_RED_FACTOR + pixel.G * GRAYSCALE_GREEN_FACTOR + pixel.B * GRAYSCALE_BLUE_FACTOR)); }
/// <summary> /// This method allow to write on the TE35 Display /// </summary> /// <param name="pbColor">The color of the text (Gadgeteer.Color)</param> /// <param name="pbText">The text that we want to write</param> /// <param name="pbPositionX">The position X on the screen (Default = 10)</param> /// <param name="pbPositionY">The position Y on the screen (Default = 10)</param> public void DisplayText(Gadgeteer.Color pbColor, string pbText = "", int pbPositionX = 10, int pbPositionY = 10) { _lcd.SimpleGraphics.DisplayTextInRectangle(pbText, pbPositionX, pbPositionY, _lcdWidth, _lcdHeight, pbColor, Resources.GetFont(Resources.FontResources.NinaB)); }
public Border AddTitleBar(string title, Font font, GT.Color foreColor, GT.Color backgroundColor) { return(AddTitleBar(title, font, foreColor, backgroundColor, backgroundColor)); }