Path构图 PointAnimation实现动画

1、首先我们构建一个Path

 <Path  Fill="#FF34CBCB" HorizontalAlignment="Left" Height="141" Margin="158.097,209.225,0,0" Stretch="Fill" Stroke="Black" VerticalAlignment="Top" Width="149.5" UseLayoutRounding="False">
                <Path.Data>
                    <PathGeometry>
                        <PathFigure StartPoint="144.5,73.5">
                            <BezierSegment Point1="144.5,113.817" Point2="112.265,146.5" Point3="72.5,146.5"/>
                            <BezierSegment Point1="32.7355,146.5" Point2="0.5,113.817" Point3="0.5,73.5"/>
                            <BezierSegment Point1="0.5,33.1832" Point2="32.7355,0.5" Point3=" 72.5,0.5"/>
                            <BezierSegment x:Name="bs" Point1="112.265,0.5" Point2="144.5,33.1832" Point3="80,0"/>
                            <LineSegment Point="70,80"/>
                        </PathFigure>
                    </PathGeometry>
                </Path.Data>
            </Path>

效果



2、利用storyboard和PointAnimation实现动画

   <Grid.Resources>
            <Storyboard x:Name="sb">
                <PointAnimation From="80,0" To="144.5,73.5" Duration="0:0:1" Storyboard.TargetName="bs" Storyboard.TargetProperty="Point3" RepeatBehavior="5"/>
 
            </Storyboard>
        </Grid.Resources>

效果是使整个圆重复闭合



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值