Drawing a line with a gradient fill?

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
 
C

Chris Dunaway

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.
 
R

Robinson

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

Thanks, that works nicely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top