求60个刻度的时钟代码翻译
Private Sub Form_Activate()Me.Picture = LoadPicture(App.Path + "\004.jpg")
Dim i, angle
Me.Width = 6000: Me.Height = 6000: Left = Screen.Width \ 2 - 4100
Top = (Screen.Height - Height) \ 2 '定位窗体的在screen中的位置
For i = 0 To 62
If i > 0 Then
Load linClock(i)
End If
linClock(i).Visible = True
linClock(i).BorderWidth = 5
Select Case i
Case 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55
linClock(i).BorderColor = RGB(0, 128, 0)
Case Else
linClock(i).BorderColor = RGB(0, 0, 255)
End Select
Next
For i = 0 To 60
Scale (-1, -1)-(1, 1)
angle = i * 6 * Atn(1) / 45
If i Mod 5 = 0 Then
linClock(i).X1 = 0.9 * Cos(angle)
linClock(i).Y1 = 0.9 * Sin(angle)
Else
linClock(i).X1 = 0.99 * Cos(angle)
linClock(i).Y1 = 0.99 * Sin(angle)
End If
linClock(i).X2 = Cos(angle)
linClock(i).Y2 = Sin(angle)
Next
Call Timego
End Sub
Private Sub tmrclock_Timer()
Call Timego
End Sub
Sub Timego()
Const HourHand = 0
Const MinuteHand = 1
Const SecondHand = 2
Dim angle
Static lastsecond
Caption = Date & Space(3) & Time
If Second(Now) = lastsecond Then Exit Sub
lastsecond = Second(Now)
angle = -0.5236 * (15 - (Hour(Now) + Minute(Now) / 60))
linClock(HourHand).X1 = 0
linClock(HourHand).Y1 = 0
linClock(HourHand).X2 = 0.5 * Cos(angle)
linClock(HourHand).Y2 = 0.5 * Sin(angle)
angle = -0.1047 * (75 - (Minute(Now) + Second(Now) / 60))
linClock(MinuteHand).X1 = 0
linClock(MinuteHand).Y1 = 0
linClock(MinuteHand).X2 = 0.7 * Cos(angle)
linClock(MinuteHand).Y2 = 0.7 * Sin(angle)
angle = -0.1047 * (75 - Second(Now))
linClock(SecondHand).X1 = 0
linClock(SecondHand).Y1 = 0
linClock(SecondHand).X2 = 0.8 * Cos(angle)
linClock(SecondHand).Y2 = 0.8 * Sin(angle)
End Sub
求这个工程的详细翻译在线等