VB.net已經(jīng)有專門繪圖的類。
可以定義筆刷然后用Drawing類中的方法繪制。
PrivateSubDrawEllipse()
DimmyPenAsNewSystem.Drawing.Pen(System.Drawing.Color.Red)
DimformGraphicsasSystem.Drawing.Graphics
formGraphics=Me.CreateGraphics()
formGraphics.DrawEllipse(myPen,NewRectangle(0,0,200,300))
myPen.Dispose()
formGraphics.Dispose()
EndSub
PrivateSubDrawRectangle()
DimmyPenAsNewSystem.Drawing.Pen(System.Drawing.Color.Red)
DimformGraphicsasSystem.Drawing.Graphics
formGraphics=Me.CreateGraphics()
formGraphics.DrawRectangle(myPen,NewRectangle(0,0,200,300))
myPen.Dispose()
formGraphics.Dispose()
EndSub