views:

42

answers:

1

Suppose I had two brushes.
One that was a linear gradient brush that was from Dark to light
One was a radial brush that went from Dark to light.

How could I merge the brushes so that when I apply them, I can apply both at once.
EG Check this:
1) http://www.codeproject.com/KB/vista/WindowsVistaRenderer/VistaRenderer4.gif
2) http://www.codeproject.com/KB/vista/WindowsVistaRenderer/VistaRenderer5.gif

How could I (In WPF/XAML) merge both into one gradient and then refer to that? (This is Mr. Menendez's Images from Codeproject)

+1  A: 

Short answer, there is no way to "merge" two different gradient brushes into one. However, there are workarounds that will get the job done for you. You could, for example, create two overlaid Border elements (using a Grid), one with the linear brush and the other with the gradient brush. You could then set the alpha component of each of the colors in the brushes to 50% transparency. In that manner, the brushes would be rendered one on top of the other, but both would show up equally well.

Charlie