Silverlight XAML Primer 4, Listing 3

Filling text with a gradient using the LinearGradientBrush element.

<Canvas xmlns="http://schemas.microsoft.com/client/2007">
 <TextBlock FontFamily="Arial" FontSize="70" Text="Text with Gradient">
  <TextBlock.Foreground>
   <LinearGradientBrush StartPoint=".49,.49" EndPoint=".51,.51" 
 SpreadMethod="Repeat">
    <GradientStop Color="Yellow" Offset="0" />
    <GradientStop Color="Red" Offset="1"/>
   </LinearGradientBrush>
  </TextBlock.Foreground> 
 </TextBlock>
</Canvas>

comments powered by Disqus
Most   Popular
Upcoming Events

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.