Exemplo n.º 1
0
 public static void UpdateDisplay(ushort temp, ushort humidity, Int32 pressurePa, UInt32 lux, UInt16 infraredSpectrum, AdcSample sample)
 {
     canvas.DrawRectangleFilled(
         180, 30,
         300, 162,
         ColorHelpers.GetRGB24toRGB565(0, 0, 0));
     canvas.DrawString(
         TextAlignmentX, 40,
         ColorHelpers.GetRGB24toRGB565(255, 255, 255),
         VerdanaBold14.ID,
         temp.ToString());
     canvas.DrawString(
         TextAlignmentX, 65,
         ColorHelpers.GetRGB24toRGB565(255, 255, 255),
         VerdanaBold14.ID,
         humidity.ToString());
     canvas.DrawString(
         TextAlignmentX, 90,
         ColorHelpers.GetRGB24toRGB565(255, 255, 255),
         VerdanaBold14.ID,
         lux.ToString());
     canvas.DrawString(
         TextAlignmentX, 115,
         ColorHelpers.GetRGB24toRGB565(255, 255, 255),
         VerdanaBold14.ID,
         infraredSpectrum.ToString());
     canvas.DrawString(
         TextAlignmentX, 140,
         ColorHelpers.GetRGB24toRGB565(255, 255, 255),
         VerdanaBold14.ID,
         pressurePa.ToString());
     canvas.DrawProgressBar(
         148, 171,
         154, 10,
         RoundedCornerStyle.All,
         RoundedCornerStyle.All,
         ColorHelpers.GetRGB24toRGB565(214, 214, 214),
         ColorHelpers.GetRGB24toRGB565(108, 224, 217),
         ColorHelpers.GetRGB24toRGB565(255, 255, 255),
         ColorHelpers.GetRGB24toRGB565(233, 15, 7),
         (int)DaqUtility.MapRange(0, 4095, 0, 100, (double)sample.Values[(int)ADC.A0]));
     canvas.Execute();
 }
Exemplo n.º 2
0
 public static void RenderCompoundShapes(VirtualCanvas canvas, FontInfo fontInfo)
 {
     canvas.DrawProgressBar(
         70, 140,
         75, 12,
         CornerStyle,
         CornerStyle,
         (ushort)BasicColor.Black,
         (ushort)GrayScaleValues.Gray_128,
         (ushort)GrayScaleValues.Gray_30,
         (ushort)BasicColor.Green,
         78);
     canvas.DrawString(5, 144, (ushort)BasicColor.Black, fontInfo.ID, "Progress");
     canvas.DrawString(155, 144, (ushort)BasicColor.Black, fontInfo.ID, "78%");
     canvas.DrawRectangleFilled(0, 275, 239, 319, (ushort)GrayScaleValues.Gray_80);
 }