Drawing a line with a gradient fill?

  • Thread starter Thread starter Robinson
  • Start date Start date
R

Robinson

Haven't had much luck googling this one: I want to draw a line with a
gradient fill, that is a line connecting two shapes in a graphics program,
where each shape is a different colour (say, Red -> Blue). Now I suppose I
can draw a filled-polygon (rotating it to the correct position to avoid
awkward end-point issues), but I'm wondering if there is any easier way ;).

Thanks,


Robin
 
Robinson said:
Haven't had much luck googling this one: I want to draw a line with a
gradient fill, that is a line connecting two shapes in a graphics program,
where each shape is a different colour (say, Red -> Blue). Now I suppose I
can draw a filled-polygon (rotating it to the correct position to avoid
awkward end-point issues), but I'm wondering if there is any easier way ;).

Create a Pen using the constructor that takes a Brush as one of the
argument. Pass in a LinearGradientBrush for this argument.
 
Back
Top