Drawing a line with a gradient fill?

Discussion in 'Microsoft VB .NET' started by Robinson, Nov 28, 2006.

  1. Robinson

    Robinson Guest

    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, Nov 28, 2006
    #1
    1. Advertisements

  2. Robinson wrote:
    > 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.
     
    Chris Dunaway, Nov 28, 2006
    #2
    1. Advertisements

  3. Robinson

    Robinson Guest

    > 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.
     
    Robinson, Nov 28, 2006
    #3
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Herfried K. Wagner [MVP]

    Re: Radian to Gradient

    Herfried K. Wagner [MVP], Sep 30, 2003, in forum: Microsoft VB .NET
    Replies:
    3
    Views:
    1,677
    Herfried K. Wagner [MVP]
    Oct 1, 2003
  2. Phill.  W

    Drawing.Icon to Drawing.Image, anyone?

    Phill. W, May 24, 2004, in forum: Microsoft VB .NET
    Replies:
    1
    Views:
    233
    Herfried K. Wagner [MVP]
    May 24, 2004
  3. Adam Maltby

    Elipse style fill gradient in a rectangle?

    Adam Maltby, Aug 17, 2004, in forum: Microsoft VB .NET
    Replies:
    2
    Views:
    240
    Adam Maltby
    Aug 18, 2004
  4. pooja
    Replies:
    0
    Views:
    801
    pooja
    Jul 12, 2006
  5. Mirco Attocchi

    Crystal Report Fill Gradient

    Mirco Attocchi, Sep 5, 2007, in forum: Microsoft VB .NET
    Replies:
    2
    Views:
    912
    Mirco Attocchi
    Sep 5, 2007
Loading...

Share This Page