i am trying to learn how to make a small paint program and would like to know how to draw lines in a picture box. I know how to draw lines on the form, just not the picture box
Printable View
i am trying to learn how to make a small paint program and would like to know how to draw lines in a picture box. I know how to draw lines on the form, just not the picture box
hum....
try whit the Get/Set pixel..
I can't help you because I dont know how to use it ..
But I sure that you can whit thoses commands. .
You can use the same function that used on a form:
Picture1.Line (x1, y1)-(x2, y2), RGB(200, 10, 10)
is that what you want?
Try this:
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