-
Im trying to make a program that allows a user to draw "free-hand" images with the mouse in a PictureBox. The user should also be aloud to select a color as well as a pen size. If anyone has an idea as to how to do this i would greatly appreciate it. Thanks for your help and you may e-mail me at [email protected]
-
Is this what your looking for?
Code:
Public A, B As Integer
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Picture1.Line (A, B)-(X, Y)
A = X: B = Y
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Picture1.Line (X, Y)-(X + 15, Y + 15)
End Sub
-
your the best thanks!!
that is exactly what i am looking for thank you so much now i only have a few more labs to do...Thank you so much for your help you dont know how much it means
-
To change the color of the line, change the Picturebox's ForeColor.
To change the size of the line, change the Picturebox's DrawWidth.