<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	Width="500" Height="500" Background="Black">



  <!-- opacity mask -->
  <Rectangle Canvas.Top="25" Canvas.Left="25" Width="150" Height="150" Fill="Magenta" />

  <Canvas x:Name="opacityMask" Canvas.Left="0" Canvas.Top="0" Width="150" Height="150" Background="Green">
  	  <Canvas.OpacityMask>
		<SolidColorBrush Color="#80ff0000" />
	  </Canvas.OpacityMask>

	  <Rectangle Width="50" Height="50" Canvas.Left="130" Canvas.Top="50" Fill="Blue" />
  </Canvas>


  <!-- parent opacity -->
  <Rectangle Canvas.Top="225" Canvas.Left="25" Width="150" Height="150" Fill="Magenta" />

  <Canvas x:Name="parent-opacity" Canvas.Left="0" Canvas.Top="200" Width="150" Height="150" Background="Green" Opacity="0.5">
	  <Rectangle Width="50" Height="50" Canvas.Left="130" Canvas.Top="50" Fill="Blue" />
  </Canvas>


  <!-- clip mask  -->
  <Rectangle Canvas.Top="25" Canvas.Left="225" Width="150" Height="150" Fill="Magenta" />

  <Canvas x:Name="clip-mask" Canvas.Left="200" Canvas.Top="0" Width="150" Height="150" Background="Green">
  	  <Canvas.Clip>
		<EllipseGeometry Center="100,100" RadiusX="75" RadiusY="30" />
	  </Canvas.Clip>
	  <Rectangle Width="50" Height="50" Canvas.Left="130" Canvas.Top="50" Fill="Blue" />
  </Canvas>

  <!-- child opacity -->
  <Rectangle Canvas.Top="225" Canvas.Left="225" Width="150" Height="150" Fill="Magenta" />

  <Canvas x:Name="child-opacity" Canvas.Left="200" Canvas.Top="200" Width="150" Height="150" Background="Green">
	  <Rectangle Width="50" Height="50" Canvas.Left="130" Canvas.Top="50" Fill="Blue" Opacity="0.5" />
  </Canvas>

</Canvas>