Silverlight XAML Primer 5, Listing 1

Using the LinearGradientBrush to create a gradient within a rectangle.

<Canvas xmlns="">

 <Ellipse Width="500" Height="500">
   <RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.5,0.5"
    RadiusX="0.5" RadiusY="0.5">
    <GradientStop Color="Yellow" Offset="0" />
    <GradientStop Color="Red" Offset="0.25" />
    <GradientStop Color="Blue" Offset="0.75" />
    <GradientStop Color="LimeGreen" Offset="1" />

comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.