siverlight图片剪切显示

  1. <StackPanel x:Name="LayoutRoot" Orientation="Horizontal" Background="White"> 
  2.         <!--原图--> 
  3.         <Image Source="../images/Silverlight.jpg" Width="340" Height="217"> 
  4.         </Image> 
  5.         <!--声明Clip属性的位图--> 
  6.         <Image Source="../images/Silverlight.jpg" Width="340" Height="217"> 
  7.             <Image.Clip> 
  8.                 <EllipseGeometry RadiusX="100" RadiusY="100" Center="200,100"> 
  9.                 </EllipseGeometry> 
  10.             </Image.Clip> 
  11.         </Image> 
  12.         <Image Source="../images/Silverlight.jpg" Width="340" Height="217"> 
  13.             <Image.Clip> 
  14.                 <PathGeometry> 
  15.                     <!-- 指明是闭线条并且指定起始位置--> 
  16.                     <PathFigure IsClosed="True" StartPoint="50,50"> 
  17.                         <LineSegment Point="10,150" /> 
  18.                         <LineSegment Point="150,75" /> 
  19.                         <LineSegment Point="10,75" /> 
  20.                         <LineSegment Point="150,150" /> 
  21.                     </PathFigure> 
  22.                 </PathGeometry> 
  23.             </Image.Clip> 
  24.         </Image> 
  25.     </StackPanel> 

  运行结果:

  

  两个裁剪效果

  本文来自work201003的博客,原文地址:http://blog.csdn.net/work201003/article/details/7014412

你可能感兴趣的:(siverlight图片剪切显示)