drawing a line on a picture box and saving coordinates

shachar8

New member
drawing a line on a picture box and saving coordinates

hello. i put this code in the MouseMove event of the form and i would like to draw a free line on a picture-box , according to the mouse movement. i would also like to save all the points(x,y) along the free-line in-order to draw the same line in other place. i would like to save the points in 2 collections: x-collection and y-collection. this is the code, and it only saves some of the points along the line, not all of them. Private Sub myPic_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = 1 Then `left button form.picBox.Line (form.picBox.CurrentX, form.picBox.CurrentY)-(x, y), 0 Xcollection.Add x Ycollection.Add y End If End Sub
 
למעלה