7,763
社区成员
发帖
与我相关
我的任务
分享
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim graph As Graphics = Me.CreateGraphics
Dim pencil1 As Pen = New Pen(Color.Blue, 2)
Dim pencil2 As Pen = New Pen(Color.Red, 3)
Dim x1, y1, y As Single
graph.TranslateTransform(60, 60)
pencil2.SetLineCap(Drawing2D.LineCap.Flat, Drawing2D.LineCap.ArrowAnchor, Drawing2D.DashCap.Flat)
graph.DrawLine(pencil2, 100, 150, 100, 5)
graph.DrawLine(pencil2, 20, 100, 180, 100)
x1 = 30
y1 = 8
For i = 31 To 170
y = (100 - (-10 + (i - 50) / 5) ^ 2) / 2 + 50
graph.DrawLine(pencil1, x1, y1, i, y)
x1 = i
y1 = y
Next
graph.Dispose()
End Sub