public MapExample()
{
InitializeComponent();
Timer clock = new Timer();
clock.Interval =1000;
clock.Tick += delegate { Invalidate(); };
clock.Start();
}
//重载OnPaint
protected override void OnPaint(PaintEventArgs e)
{
DateTime time = DateTime.Now;
using (Graphics g = e.Graphics)
{
g.DrawEllipse(new Pen(Brushes.Blue, 1), 0, 0, 200, 200);//圈
g.TranslateTransform(100.0f,100.0f);
System.Drawing.Drawing2D.GraphicsState state = g.Save();
g.RotateTransform(time.Second * 6 - 90);//设置旋转的角度
g.FillEllipse(new SolidBrush(Color.Green), 65, 65, 10, 10);//小点
}
}