LinearGradientBrush : WPF Shapes « WPF « ASP.Net






LinearGradientBrush


<Canvas xmlns="http://schemas.microsoft.com/client/2007">
  <TextBlock Canvas.Left="25" 
             Canvas.Top="10" 
             FontFamily="Verdana" 
         FontSize="32" 
         FontWeight="Bold" 
         Text="ASP.NET">
    <TextBlock.Foreground>
      <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
        <GradientStop Color="Red" Offset="0.0" />
        <GradientStop Color="Orange" Offset="0.2" />
        <GradientStop Color="Yellow" Offset="0.4" />
        <GradientStop Color="Green" Offset="0.6" />
        <GradientStop Color="Blue" Offset="0.8" />
        <GradientStop Color="Violet" Offset="1.0" />
      </LinearGradientBrush>
    </TextBlock.Foreground>

    <TextBlock.RenderTransform>
      <ScaleTransform ScaleY="2.0" />
    </TextBlock.RenderTransform>

    <LineBreak/>
    <Run Foreground="Teal" FontFamily="Verdana" FontSize="24">Core Reference</Run>
    <LineBreak/>
    <Run Foreground="Teal" FontFamily="Verdana" FontSize="18" FontStyle="Italic">Dino Esposito,</Run>
    <Run Foreground="SteelBlue" FontFamily="Verdana" FontSize="18" FontStyle="Italic">Microsoft Press, 2008</Run>
  </TextBlock>
</Canvas>

 








Related examples in the same category

1.TextBlock
2.Ellipse
3.Polyline
4.RectangleGeometry
5.Ellipse.OpacityMask
6.Rectangle.RenderTransform
7.Nested Canvas