Can anyone help with this?
I have a form with a small picture (Picture2) on a large picture (Picture1). I want to manually draw a series of red lines on Picture2. The lines are rubber lines and may be drawn across one another. They should also be permanent as long as the program runs,
The following program works but the lines are not red (?)
If I change Picture 2.DrawMode to 13 then the line is red, but the blanking line doesn’t work and I get a red arc segment as the line sweeps across the picture (?)
With Picture2.DrawMode = 13 and Lincol of the blanking line changed to vbWhite, I get red lines but sweeping a line across another line erases that portion of the original line (?)
Option Explicit
Dim XOffset As Single, YOffset As Single, StLx As Single, StLy As Single
Dim OldX As Single, OldY As Single, LinCol As String, X As Single, Y As Single
Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button <> 1 Then Exit Sub
LinCol = vbRed
Picture2.AutoRedraw = True
Picture2.Refresh
Picture2.DrawMode = 7
OldX = X
OldY = Y
StLx = X
StLy = Y
End Sub
Private Sub Picture2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button <> 1 Then Exit Sub
Picture2.Line (StLx, StLy)-(OldX, OldY), LinCol ‘ blanking line
Picture2.Line (StLx, StLy)-(X, Y), LinCol
OldX = X
OldY = Y
End Sub
I have a form with a small picture (Picture2) on a large picture (Picture1). I want to manually draw a series of red lines on Picture2. The lines are rubber lines and may be drawn across one another. They should also be permanent as long as the program runs,
The following program works but the lines are not red (?)
If I change Picture 2.DrawMode to 13 then the line is red, but the blanking line doesn’t work and I get a red arc segment as the line sweeps across the picture (?)
With Picture2.DrawMode = 13 and Lincol of the blanking line changed to vbWhite, I get red lines but sweeping a line across another line erases that portion of the original line (?)
Option Explicit
Dim XOffset As Single, YOffset As Single, StLx As Single, StLy As Single
Dim OldX As Single, OldY As Single, LinCol As String, X As Single, Y As Single
Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button <> 1 Then Exit Sub
LinCol = vbRed
Picture2.AutoRedraw = True
Picture2.Refresh
Picture2.DrawMode = 7
OldX = X
OldY = Y
StLx = X
StLy = Y
End Sub
Private Sub Picture2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button <> 1 Then Exit Sub
Picture2.Line (StLx, StLy)-(OldX, OldY), LinCol ‘ blanking line
Picture2.Line (StLx, StLy)-(X, Y), LinCol
OldX = X
OldY = Y
End Sub