मैं करना चाहते हैं आकर्षित करने के लिए कुछ लाइनों के साथ एक छवि पर माउस का उपयोग कर ले जाने में vb.net. मेरी समस्या यह है कि जब मैं ड्राइंग शुरू, अगली पंक्ति पिछली पंक्ति गायब हो जाता है! कर सकते हैं किसी को भी मेरी मदद? मैं कोड की एक तस्वीर के साथ चलाने के लिए मेरा परियोजना
Dim st, en As New Point
Dim p As Pen
Private mouseButtonPressed As Boolean = False
Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint
p = New Pen(Color.Black, 2)
Dim g As Graphics = e.Graphics
g.DrawLine(p, st, en)
End Sub
Private Sub PictureBox1_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseUp
mouseButtonPressed = False
End Sub
Private Sub PictureBox1_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseMove
If mouseButtonPressed Then
PictureBox1.Invalidate()
en = e.Location
End If
End Sub
Private Sub PictureBox1_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseDown
If e.Button = MouseButtons.Left Then
st = New Point(e.X, e.Y)
mouseButtonPressed = True
End If
End Sub