I found this code in this newsgroup and used it, but the lines drawn
are composed of point too separated when the mouse moves at medium or
fast speed. How can I fix it?
Thanks in advance !!!
Dim bTracking As Boolean
Dim blackPen As Pen
Dim g As Graphics
Private Sub frmFirma_Load(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
blackPen = New Pen(Color.Black , 2)
blackPen.LineJo in = Drawing2D.LineJ oin.Round
g = PictureBox1.Cre ateGraphics()
End Sub
Private Sub AddPoint(ByVal e As
System.Windows. Forms.MouseEven tArgs)
g.DrawLine(blac kPen, e.X, e.Y, e.X + 1, e.Y + 1)
End Sub
Private Sub PictureBox1_Mou seDown(ByVal sender As Object, ByVal e
As System.Windows. Forms.MouseEven tArgs) Handles PictureBox1.Mou seDown
bTracking = True
AddPoint(e)
End Sub
Private Sub PictureBox1_Mou seMove(ByVal sender As Object, ByVal e
As System.Windows. Forms.MouseEven tArgs) Handles PictureBox1.Mou seMove
If bTracking Then
AddPoint(e)
End If
End Sub
Private Sub PictureBox1_Mou seUp(ByVal sender As Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles PictureBox1.Mou seUp
If bTracking Then
AddPoint(e)
bTracking = False
End If
End Sub
Protected Overrides Sub Finalize()
g.Dispose()
MyBase.Finalize ()
End Sub