Clip裁剪特效

裁剪特效(Clip),允许对Silverlight元素进行裁剪,裁剪形状由Clip属性内包含的Geometry决定,下面直接上代码:

<StackPanel x:Name="LayoutRoot" Orientation="Horizontal" Background="White">
        <!--原图-->
        <Image Source="../images/Silverlight.jpg" Width="340" Height="217">
        </Image>
        <!--声明Clip属性的位图-->
        <Image Source="../images/Silverlight.jpg" Width="340" Height="217">
            <Image.Clip>
                <EllipseGeometry RadiusX="100" RadiusY="100" Center="200,100">
                </EllipseGeometry>
            </Image.Clip>
        </Image>
        <Image Source="../images/Silverlight.jpg" Width="340" Height="217">
            <Image.Clip>
                <PathGeometry>
                    <!-- 指明是闭线条并且指定起始位置-->
                    <PathFigure IsClosed="True" StartPoint="50,50">
                        <LineSegment Point="10,150" />
                        <LineSegment Point="150,75" />
                        <LineSegment Point="10,75" />
                        <LineSegment Point="150,150" />
                    </PathFigure>
                </PathGeometry>
            </Image.Clip>
        </Image>
    </StackPanel>

运行结果:

Silverlight开发历程—(Clip裁剪特效)

两个裁剪效果

相关文章:

  • 2021-09-14
  • 2021-05-23
  • 2021-09-07
  • 2022-03-05
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-05
  • 2021-12-13
  • 2022-01-17
  • 2021-05-10
相关资源
相似解决方案