Hello, how can I clear graphics with solid colour???
I tried clear method but I am getting error Value of type 'System.Drawing.SolidBrush' cannot be converted to 'System.Drawing.Color' and it's necessary to be solid.
Here is my code that I create graphics, but I need all the graphics disapear if cnt is greater than 1.
Private Sub Button1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseMove
Dim g As System.Drawing.Graphics
Dim brsh As SolidBrush
Dim points(CType(keyCoords(0), ArrayList).Count - 1) As Point
If cnt = 1 then
For i As Integer = 0 To CType(keyCoords(0), ArrayList).Count - 1
points(i) = CType(CType(keyCoords(0), ArrayList)(i), Point)
Next
g = PictureBox1.CreateGraphics()
brsh = New SolidBrush(Color.FromArgb(130, 255, 255, 0))
g.FillPolygon(brsh, points)
brsh.Dispose()
ElseIf cnt > 1 then
g.clear(brsh)
End If
End Sub
I tried clear method but I am getting error Value of type 'System.Drawing.SolidBrush' cannot be converted to 'System.Drawing.Color' and it's necessary to be solid.
Here is my code that I create graphics, but I need all the graphics disapear if cnt is greater than 1.
Private Sub Button1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseMove
Dim g As System.Drawing.Graphics
Dim brsh As SolidBrush
Dim points(CType(keyCoords(0), ArrayList).Count - 1) As Point
If cnt = 1 then
For i As Integer = 0 To CType(keyCoords(0), ArrayList).Count - 1
points(i) = CType(CType(keyCoords(0), ArrayList)(i), Point)
Next
g = PictureBox1.CreateGraphics()
brsh = New SolidBrush(Color.FromArgb(130, 255, 255, 0))
g.FillPolygon(brsh, points)
brsh.Dispose()
ElseIf cnt > 1 then
g.clear(brsh)
End If
End Sub