Visual Basic NET ( 3)




- 4


= New Bitmap(Me.Width, Me.Height)

= Graphics.FromImage()

= Me.CreateGraphics

.StartCap = Drawing2D.LineCap.Round '

.EndCap = Drawing2D.LineCap.Round

End Sub

Private Sub __Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _

Handles _.Click

ColorDialog1.ShowDialog()

.Color = ColorDialog1.Color

End Sub

Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _

Handles NumericUpDown1.ValueChanged

.Width = NumericUpDown1.Value

End Sub

Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _

Handles MyBase.MouseMove

If e.Button = MouseButtons.Left Then

' :

.DrawLine(, e.X, e.Y, X_, Y_)

.DrawLine(, e.X, e.Y, X_, Y_)

' MouseMove,

:

X_ = e.X

Y_ = e.Y

End If

End Sub

Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _

Handles MyBase.MouseDown

' , ,

:

X_ = e.X

Y_ = e.Y

End Sub