' Draw a line from (x1, y1) to (x2, y2)
' using the desired texture.
Private Sub DrawHatchLine(ByVal gr As Graphics, ByVal _
point1 As Point, ByVal point2 As Point, ByVal _
hatch_style As HatchStyle, ByVal fore_color As Color, _
ByVal back_color As Color, ByVal line_width As Single)
' Make the brush.
Dim the_brush As New HatchBrush( _
hatch_style, fore_color, back_color)
' Use the brush to make the pen.
Dim the_pen As New Pen(the_brush, line_width)
the_pen.StartCap = LineCap.Round
the_pen.EndCap = LineCap.Round
' Draw the line.
gr.DrawLine(the_pen, point1, point2)
' Clean up.
the_pen.Dispose()
the_brush.Dispose()
End Sub
|