I'm using the code
Sub PicCanvasMouseDown(sender As Object, e As MouseEventArgs)
XPrev = e.X
YPrev = e.Y
End Sub
Sub PicCanvasMouseUp(sender As Object, e As MouseEventArgs)
XCur = e.X
YCur = e.Y
End Sub
Sub PicCanvasPaint(sender As Object, e As PaintEventArgs)
Dim p As New Pen(Color.Black, 10)
Dim g As Graphics = e.Graphics
g.DrawLine(p, XPrev, YPrev, XCur, YCur)
PicCanvas.Invalidate()
End Sub
To draw a line on a PictureBox. It works fine, until you go to draw another line, when the first line dissapears, i presume this is because i'm using the same integer variables for each one (XPrev, YPrev, XCur, YCur.) How would i be able to use the same integer variables, but be able to draw more than one line ?