Private Sub Timer1_Timer()
Dim Angle, PX, PY, OX, OY, WX, WY
P1.Cls
'Get Hr Angle...
Angle = (180 - (Hour(Now) * 6) * 5 - (Minute(Now) * 6) _
/ 12) * 3.1415 / 180
'Hr. point
PX = X + (hWidth * Sin(Angle))
PY = Y + (hWidth * Cos(Angle))
'Opposite side
OX = X - (Sin(Angle) * 100)
OY = Y - (Cos(Angle) * 100)
'Hand width
WX = Sin(Angle + PI2) * 90
WY = Cos(Angle + PI2) * 90
'Draw Hr. hand...
P1.Line (OX, OY)-(PX, PY), vbYellow ' From opposite
' side to pointer
P1.Line -(OX + WX, OY + WY), vbBlue ' To one opposite
' side
P1.Line -(OX - WX, OY - WY), vbBlue ' To other
' opposite side
P1.Line -(PX, PY), vbBlue ' Back to pointer
P1.Circle (X, Y), 50, vbYellow
'Get Min Angle...
Angle = (180 - (Minute(Now) * 6)) * 3.1415 / 180
'Min point
PX = X + (mWidth * Sin(Angle))
PY = Y + (mWidth * Cos(Angle))
'Opposite side
OX = X - (Sin(Angle) * 100)
OY = Y - (Cos(Angle) * 100)
'Hand width
WX = Sin(Angle + PI2) * 90
WY = Cos(Angle + PI2) * 90
'Draw Min. hand...
P1.Line (OX, OY)-(PX, PY), vbYellow ' From opposite
' side to pointer
P1.Line -(OX + WX, OY + WY), vbMagenta ' To one
' opposite side
P1.Line -(OX - WX, OY - WY), vbMagenta ' To other
' opposite side
P1.Line -(PX, PY), vbMagenta ' Back to pointer
P1.Circle (X, Y), 50, vbYellow
'Get Sec Angle...
Angle = (180 - (Second(Now) * 6)) * 3.1415 / 180
'Draw Sec. hand...
P1.Line (X, Y)-(X + (sWidth * Sin(Angle)), Y + (sWidth _
* Cos(Angle))), vbRed
End Sub
|