Ellipse.OpacityMask : WPF Shapes « WPF « ASP.Net






Ellipse.OpacityMask



<Canvas
    xmlns="http://schemas.microsoft.com/client/2007"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Width="200" Height="200">

  <Ellipse
    Canvas.Left="5" Canvas.Top="5" Canvas.ZIndex="1"
    Height="200" Width="200"
    Stroke="Black" StrokeThickness="10" Fill="Silver">
    <Ellipse.OpacityMask>
      <LinearGradientBrush>
        <GradientStop Offset="0.25" Color="#00000000"/>
        <GradientStop Offset="1" Color="#FF000000"/>
      </LinearGradientBrush>
    </Ellipse.OpacityMask>
  </Ellipse>

  <Ellipse
    Canvas.Left="50" Canvas.Top="50" Canvas.ZIndex="3"
    Height="200" Width="200"
    Stroke="Black" StrokeThickness="10">
    <Ellipse.Fill>
      <LinearGradientBrush>
        <GradientStop Offset="0.00" Color="#ffffff"/>
        <GradientStop Offset="1.00" Color="DeepSkyBlue"/>
      </LinearGradientBrush>
    </Ellipse.Fill>    
  </Ellipse>


  <Ellipse
    Canvas.Left="95" Canvas.Top="95" Canvas.ZIndex="2"
    Height="200" Width="200"
    Stroke="Black" StrokeThickness="10" Fill="Lime" />

</Canvas>

 








Related examples in the same category

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