Private Sub Form_Load()
Me.AutoRedraw = True
Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), RGB(255, 0, 0), BF
Line (0, 0)-(Me.ScaleWidth / 2, Me.ScaleHeight / 2), RGB(0, 0, 255), BF
Me.FillStyle = 0: Me.FillColor = &HFFFFFF
Circle (Me.ScaleWidth / 4, Me.ScaleHeight / 4), Me.ScaleHeight / 8, &HFFFFFF
For i = 0 To 330 Step 30
 Call draw(3 * Me.ScaleHeight / 16 - Me.ScaleHeight / 32, CDbl(i))
Next i
End Sub

Sub draw(length As Integer, d As Double)
x = Me.ScaleWidth / 4 + length * Sin((3.14159 * d) / 180)
y = Me.ScaleHeight / 4 + length * Cos((3.14159 * d) / 180)
Circle (x, y), 10, &H0
Dim xx(2) As Double, yy(2) As Double
For j = 1 To Me.ScaleHeight / 32 Step 10
 c = d + 120: If c >= 360 Then c = c - 360
 xx(0) = x + j * Sin(3.14159 * (c) / 180)
 yy(0) = y + j * Cos(3.14159 * (c) / 180)
 c = d + 0: If c >= 360 Then c = c - 360
 xx(1) = x + j * Sin(3.14159 * (c) / 180)
 yy(1) = y + j * Cos(3.14159 * (c) / 180)
 c = d + 240: If c >= 360 Then c = c - 360
 xx(2) = x + j * Sin(3.14159 * (c) / 180)
 yy(2) = y + j * Cos(3.14159 * (c) / 180)
 For i = 0 To 1
  Line (xx(i), yy(i))-(xx(i + 1), yy(i + 1)), &HFFFFFF
 Next i
 Line (xx(2), yy(2))-(xx(0), yy(0)), &HFFFFFF
Next j
End Sub

Private Sub Form_Resize()
Cls
Form_Load
End Sub

arrow
arrow
    全站熱搜

    h881068 發表在 痞客邦 留言(0) 人氣()