Const DX = 3500
Const DY = 2300
Const PI = 3.1415926
Private Sub Form_Load()
Label1.Visible = False
Dim i As Integer
Shape1.Visible = False
Linem.X1 = DX
Linem.Y1 = DY
Lines.X1 = DX
Lines.Y1 = DY
Lineh.X1 = DX
Lineh.Y1 = DY
Shape1.Left = DX - 2000
Shape1.Top = DY - 2000
Shape1.Width = 4000
Shape1.Height = 4000
img_hwid = Image1(0).Width / 2
img_hheg = Image1(0).Height / 2
Form1.Refresh
End Sub
Private Sub Form_Paint()
Dim i As Integer
Form1.DrawWidth = 4
For i = 0 To 59
If (i Mod 5) = 0 Then
Form1.DrawWidth = 7
Else
Form1.DrawWidth = 4
End If
Form1.PSet (DX + 2000 * Cos((i - 60) * 2 * PI / 60 - PI / 2), DY + 2000 * Sin((i - 60) * 2 * PI / 60 - PI / 2))
Next i
End Sub
Private Sub Timer1_Timer()
Dim h As Integer, s As Integer, mm As Integer
s = Second(Time) '秒
mm = Minute(Time) '分
h = Hour(Time) '时
If h >= 12 Then h = h - 12
Lineh.X2 = 800 * Cos((h - 12) * 2 * PI / 12 - PI / 2) + DX
Lineh.Y2 = 800 * Sin((h - 12) * 2 * PI / 12 - PI / 2) + DY
Lines.X2 = 1300 * Cos((s - 60) * 2 * PI / 60 - PI / 2) + DX
Lines.Y2 = 1300 * Sin((s - 60) * 2 * PI / 60 - PI / 2) + DY
Linem.X2 = 1000 * Cos((mm - 60) * 2 * PI / 60 - PI / 2) + DX
Linem.Y2 = 1000 * Sin((mm - 60) * 2 * PI / 60 - PI / 2) + DY
End Sub