C
C
arrowBrush.LinearColors(0) = Color.FromArgb(0, 255, 128)
arrowBrush.LinearColors(1) = Color.FromArgb(255, 0, 128)
What am I doing wrong?
The whole code, by the way is as follows. This is still very
preliminary.
Sub drawArrow(ByVal g As Graphics, ByVal hv As Short, ByVal
arrowLength As Short, ByVal arrowThick As Short, ByVal arrowWidth As
Short)
Dim arrowPoints(6) As Point
Dim rect As Rectangle = New Rectangle(10, 10, 1, 1)
If hv = 1 Then
rect.Height = arrowWidth
rect.Width = arrowLength
Else
rect.Height = arrowLength
rect.Width = arrowWidth
End If
Dim arrowBrush As System.Drawing.Drawing2D.LinearGradientBrush
= New System.Drawing.Drawing2D.LinearGradientBrush(rect, Color.White,
Color.Black, System.Drawing.Drawing2D.LinearGradientMode.Horizontal)
arrowBrush.LinearColors(0) = Color.FromArgb(0, 255, 128)
arrowBrush.LinearColors(1) = Color.FromArgb(255, 0, 128)
' arrowBrush.LinearColors = (Color.Blue, Color.Red)
arrowBrush.LinearColors = New Color() {Color.FromArgb(0, 255,
128), _
Color.FromArgb(255, 0, 128)}
arrowPoints(0) = New Point(10, 20) ' this should come from
arrowL, arrowW, etc.
arrowPoints(1) = New Point(50, 20)
arrowPoints(2) = New Point(50, 10)
arrowPoints(3) = New Point(70, 30)
arrowPoints(4) = New Point(50, 50)
arrowPoints(5) = New Point(50, 40)
arrowPoints(6) = New Point(10, 40)
g.FillPolygon(arrowBrush, arrowPoints)
Me.Invalidate()
End Sub
arrowBrush.LinearColors(1) = Color.FromArgb(255, 0, 128)
What am I doing wrong?
The whole code, by the way is as follows. This is still very
preliminary.
Sub drawArrow(ByVal g As Graphics, ByVal hv As Short, ByVal
arrowLength As Short, ByVal arrowThick As Short, ByVal arrowWidth As
Short)
Dim arrowPoints(6) As Point
Dim rect As Rectangle = New Rectangle(10, 10, 1, 1)
If hv = 1 Then
rect.Height = arrowWidth
rect.Width = arrowLength
Else
rect.Height = arrowLength
rect.Width = arrowWidth
End If
Dim arrowBrush As System.Drawing.Drawing2D.LinearGradientBrush
= New System.Drawing.Drawing2D.LinearGradientBrush(rect, Color.White,
Color.Black, System.Drawing.Drawing2D.LinearGradientMode.Horizontal)
arrowBrush.LinearColors(0) = Color.FromArgb(0, 255, 128)
arrowBrush.LinearColors(1) = Color.FromArgb(255, 0, 128)
' arrowBrush.LinearColors = (Color.Blue, Color.Red)
arrowBrush.LinearColors = New Color() {Color.FromArgb(0, 255,
128), _
Color.FromArgb(255, 0, 128)}
arrowPoints(0) = New Point(10, 20) ' this should come from
arrowL, arrowW, etc.
arrowPoints(1) = New Point(50, 20)
arrowPoints(2) = New Point(50, 10)
arrowPoints(3) = New Point(70, 30)
arrowPoints(4) = New Point(50, 50)
arrowPoints(5) = New Point(50, 40)
arrowPoints(6) = New Point(10, 40)
g.FillPolygon(arrowBrush, arrowPoints)
Me.Invalidate()
End Sub