g.FillRectangle(Brushes.White, this.ClientRectangle);
g.FillRectangle(Brushes.White, this.ClientRectangle); Rectangle r = new Rectangle(10, 10, 60, 180); g.FillRectangle(Brushes.LightGray, r); Rectangle r1 = new Rectangle(10, 10, 60, 60); Rectangle r2 = new Rectangle(10, 70, 60, 60); Rectangle r3 = new Rectangle(10, 130, 60, 60); switch (lightColor) { case 1: g.FillEllipse(Brushes.Red, r1); g.FillEllipse(Brushes.Black, r2); g.FillEllipse(Brushes.Black, r3); break; case 2: g.FillEllipse(Brushes.Black, r1); g.FillEllipse(Brushes.Yellow, r2); g.FillEllipse(Brushes.Black, r3); break; case 3: g.FillEllipse(Brushes.Black, r1); g.FillEllipse(Brushes.Black, r2); g.FillEllipse(Brushes.Green, r3); break; } g.FillEllipse(Brushes.Black, r3); break; case 2: g.FillEllipse(Brushes.Black, r1); g.FillEllipse(Brushes.Yellow, r2); g.FillEllipse(Brushes.Black, r3); break; case 3: g.FillEllipse(Brushes.Black, r1); g.FillEllipse(Brushes.Black, r2); g.FillEllipse(Brushes.Green, r3); break; }
暂无评论