Hi,
Thanks for your time. I have written a program that captures mouse move and draws the movement of the mouse onto a Image on the form (like the microsoft paint - freeform drawing using the pencil). Currently, I grab the mouse coordinates and draw a line just one pixel long. However, if the movement is fast it doesnt seem to grab all coordinates. There are large gaps between two points. Is there any other way in .NET to solve this problem. My code:
Thanks again,
Regards,
V
Thanks for your time. I have written a program that captures mouse move and draws the movement of the mouse onto a Image on the form (like the microsoft paint - freeform drawing using the pencil). Currently, I grab the mouse coordinates and draw a line just one pixel long. However, if the movement is fast it doesnt seem to grab all coordinates. There are large gaps between two points. Is there any other way in .NET to solve this problem. My code:
Code:
Dim gr As Graphics
Dim pen1 As New Pen(Color.Red, 1)
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Panel1.AutoScroll = True
gr = PictureBox1.CreateGraphics
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
If e.Button = MouseButtons.Left Then
gr.DrawLine(pen1, e.X, e.Y, e.X + 1, e.Y +1)
End If
End Sub
Thanks again,
Regards,
V