Connecting Tech Pros Worldwide Forums | Help | Site Map

Drawing a line with a gradient fill?

Robinson
Guest
 
Posts: n/a
#1: Nov 28 '06
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



Chris Dunaway
Guest
 
Posts: n/a
#2: Nov 28 '06

re: Drawing a line with a gradient fill?


Robinson wrote:
Quote:
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.

Robinson
Guest
 
Posts: n/a
#3: Nov 28 '06

re: Drawing a line with a gradient fill?


Create a Pen using the constructor that takes a Brush as one of the
Quote:
argument. Pass in a LinearGradientBrush for this argument.
Thanks, that works nicely.


Closed Thread