zoukankan      html  css  js  c++  java
  • Silverlight开发历程—(Clip裁剪特效)

     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>

    运行结果:

    两个裁剪效果

  • 相关阅读:
    Java Learning (201108025)
    Java Learning (20110808)
    Negative numbers and binary representation
    “this” pointer
    NullPointerException
    Special Swiss Education
    Java Learning (20110802)
    More about Swiss keyboard
    About memory leak
    Application Verifier
  • 原文地址:https://www.cnblogs.com/raphael5200/p/5114884.html
Copyright © 2011-2022 走看看