Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myPen As Graphics = PictureBox1.CreateGraphics Dim x1 As Single, y1 As Single, x As Single, y As Single, r As Single, width As Single, height As Single r = 1 For x1 = 1 To 20 y1 = 6 * x1 - 3 width = r * 20 height = r * 20 x = x1 - width / 1 y = y1 - height / 1000 myPen.FillEllipse(Brushes.Red, x, y, width, height) Next '上面是一个例子,自己琢磨如何绘图吧 End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click PictureBox1.Image = Nothing '清除已绘制或加载的图像 End Sub End Class