C# Custom Brush - I want two gradients chaining them together.

Posted by Logan on Stack Overflow See other posts from Stack Overflow or by Logan
Published on 2010-05-14T13:10:59Z Indexed on 2010/05/14 13:14 UTC
Read the original article Hit count: 239

Filed under:
|
|
|

I am making a bar chart and I want two separate gradients for each bar. First I want a gradient to go from top to bottom solid red to transparent red. I want to paint over the top of that a gradient that goes from right to left, black to opaque.

So - In the bottom left we should have;

  • Bottom left - Alpha 0
  • Bottom right - Alpha 0
  • Top left - Alpha 255 Colour Red
  • Top Right - Alpha 255 Colour Black

So in effect I want to take a solid colour, add a left to right gradient to black then take the output of that and add a top to bottom gradient to transparency.

All this and I want it to be in a single brush, is this even possible?

Thanks!

© Stack Overflow or respective owner

Related posts about wpf

Related posts about Silverlight