コード例 #1
0
ファイル: Buttons.cs プロジェクト: smallrobots/monoev3
 public override void Draw()
 {
     Lcd.DrawRectangle(outherBox, true, true);
     Lcd.DrawRectangle(innerBox, Selected, true);
     Lcd.WriteText(Font.SmallFont, textCenterPoint + textDisplacement, Text, !Selected);
     Lcd.DrawArrow(arrowRect, Lcd.ArrowOrientation.Up, !Selected);
     Lcd.DrawVLine(lineStart, lineLength, !Selected);
     Lcd.DrawVLine(lineStart + new Point(-1, 0), lineLength, !Selected);
     Lcd.DrawVLine(lineStart + new Point(+1, 0), lineLength, !Selected);
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: smallrobots/monoev3
        public static void Main(string[] args)
        {
            EventWaitHandle stopped     = new ManualResetEvent(false);
            int             centerX     = Lcd.Width / 2;
            int             centerY     = Lcd.Height / 2;
            Point           center      = new Point(centerX, centerY);
            int             refreshRate = 100;
            bool            run         = true;
            ButtonEvents    buts        = new ButtonEvents();

            buts.EscapePressed += () => {
                stopped.Set();
                run = false;
            };

            while (run)
            {
                for (int k = 0; k < 4; k++)
                {
                    for (int i = 1; i < centerY; i++)
                    {
                        Lcd.Clear();
                        Lcd.DrawCircle(center, (ushort)i, true, true);
                        Lcd.Update();
                        stopped.WaitOne(refreshRate);
                    }
                    for (int i = centerY - 1; i > 0; i--)
                    {
                        Lcd.Clear();
                        Lcd.DrawCircle(center, (ushort)i, true, true);
                        Lcd.Update();
                        stopped.WaitOne(refreshRate);
                    }
                }

                for (int k = 0; k < 20; k++)
                {
                    Lcd.Clear();
                    Lcd.DrawHLine(center, centerX / 2, true);
                    stopped.WaitOne(refreshRate);
                    Lcd.Clear();
                    Lcd.DrawVLine(center, centerY / 2, true);
                }
            }
        }
コード例 #3
0
ファイル: LcdModel.cs プロジェクト: smallrobots/monoev3
		public void DrawVLine(int x, int y, int height, bool color)
		{
			Lcd.DrawVLine(new Point(x,y), height, color);
			Lcd.Update(); 
		}