Imports System.Drawing
Imports System.Drawing.Drawing2D

Public Class Form1
    Dim myPen As Pen, myGraphics As Graphics
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Private Sub ButPathDraw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButPathDraw.Click
        myPen = Pens.Green
        myGraphics = PictureBox1.CreateGraphics
        myGraphics.DrawLine(myPen, 0, 0, 30, 20)
        myGraphics.DrawEllipse(myPen, 20, 20, 20, 40)
        myGraphics.DrawBezier(myPen, 30, 60, 70, 60, 50, 30, 100, 10)
        myPen = Pens.Red
        Dim myGraphicsPath = New GraphicsPath
        myGraphicsPath.AddLine(0, 0, 30, 20)
        myGraphicsPath.AddEllipse(20, 20, 20, 40)
        myGraphicsPath.AddBezier(30, 60, 70, 60, 50, 30, 100, 10)
        myGraphics.DrawPath(myPen, myGraphicsPath)
    End Sub
End Class
