C
C
I haven't understood what the first rectangle parameter in the brush
Dim is. I have done the following and it produces nonsense.
Dim frmImage As Bitmap = New Bitmap(1000, 800)
Sub drawArrow(ByVal g As Graphics, ByVal hv As Short, ByVal arrowL
As Short, ByVal arrowThick As Short, ByVal arrowW As Short)
Dim arrowPoints(7) As Point
Dim rect As Rectangle = New Rectangle(60, 10, 90, 40)
Dim arrowBrush As System.Drawing.Drawing2D.LinearGradientBrush
= New System.Drawing.Drawing2D.LinearGradientBrush(rect,
Color.GreenYellow, Color.Red,
System.Drawing.Drawing2D.LinearGradientMode.Horizontal)
arrowPoints(1) = New Point(60, 20)
arrowPoints(2) = New Point(120, 20)
arrowPoints(3) = New Point(120, 10)
arrowPoints(4) = New Point(150, 30)
arrowPoints(5) = New Point(120, 50)
arrowPoints(6) = New Point(120, 40)
arrowPoints(7) = New Point(60, 40)
g.FillPolygon(arrowBrush, arrowPoints)
' Will use hv, arrowL, etc. later on. First I should get it to show an
arrow with a proper gradient.
Me.Invalidate()
End Sub
Private Sub Label3_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Label3.Click
Dim g As Graphics = Graphics.FromImage(frmImage)
Call drawArrow(g, 1, 100, 12, 24)
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
e.Graphics.DrawImage(frmImage, 0, 0)
End Sub
What am I doing wrong?
Thanks.
Dim is. I have done the following and it produces nonsense.
Dim frmImage As Bitmap = New Bitmap(1000, 800)
Sub drawArrow(ByVal g As Graphics, ByVal hv As Short, ByVal arrowL
As Short, ByVal arrowThick As Short, ByVal arrowW As Short)
Dim arrowPoints(7) As Point
Dim rect As Rectangle = New Rectangle(60, 10, 90, 40)
Dim arrowBrush As System.Drawing.Drawing2D.LinearGradientBrush
= New System.Drawing.Drawing2D.LinearGradientBrush(rect,
Color.GreenYellow, Color.Red,
System.Drawing.Drawing2D.LinearGradientMode.Horizontal)
arrowPoints(1) = New Point(60, 20)
arrowPoints(2) = New Point(120, 20)
arrowPoints(3) = New Point(120, 10)
arrowPoints(4) = New Point(150, 30)
arrowPoints(5) = New Point(120, 50)
arrowPoints(6) = New Point(120, 40)
arrowPoints(7) = New Point(60, 40)
g.FillPolygon(arrowBrush, arrowPoints)
' Will use hv, arrowL, etc. later on. First I should get it to show an
arrow with a proper gradient.
Me.Invalidate()
End Sub
Private Sub Label3_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Label3.Click
Dim g As Graphics = Graphics.FromImage(frmImage)
Call drawArrow(g, 1, 100, 12, 24)
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
e.Graphics.DrawImage(frmImage, 0, 0)
End Sub
What am I doing wrong?
Thanks.