求一個vb繪圖程序,將一個圓周16等分,每個等分點標記成數字0-16,具體聯繫594227686
題目:
求一個vb繪圖程序,將一個圓周16等分,每個等分點標記成數字0-16,具體聯繫594227686
解答:
Private Sub Command2_Click() Dim x As Double, y As Double, ang As Double Dim i As Integer, r As Integer Const Pi As Single = 3.14 Me.ScaleMode = vbPixels x = (Me.ScaleWidth - 20) / 2 y = (Me.ScaleHeight - 20) / 2 r = (Me.ScaleHeight - 40) / 2 Circle (x, y), r For i = 1 To 16 Step 1 ang = (i / 16) * 2 * Pi '轉換成弧度 Line (x, y)-(x + r * Cos(ang), y + r * Sin(ang)), vbRed Me.Print i NextEnd Sub
名師點評:
dbthbfn001A5
添加新評論