Using an Image as an Opacity Mask

image_pdfimage_print


   
    
<Window  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SDKSample.SampleViewer"
    Title="Examples" >

   <Canvas> 
      <Image Height="150" Width="200" Source="c:image.jpg" HorizontalAlignment="Left" Margin="10">
        <Image.OpacityMask>
          <ImageBrush ImageSource="c:image.png"/>
        </Image.OpacityMask>
      </Image>
   </Canvas> 
</Window>