首页 > Windows开发 > 详细

[WPF,XAML] 跳动的心

时间:2019-03-27 10:10:34      阅读:134      评论:0      收藏:0      [点我收藏+]
原文:[WPF,XAML] 跳动的心

没什么艺术细胞,原谅,原谅!技术分享图片

技术分享图片

<Canvas Width="0" Height="0">
    <Canvas.Resources>
        <PathGeometry x:Key="pg">
            <PathGeometry.Figures>
                <PathFigureCollection>
                    <PathFigure StartPoint="0,0">
                        <PathFigure.Segments>
                            <PathSegmentCollection>
                                <ArcSegment Size="1,2" Point="30,30" />
                                <ArcSegment Size="2,1" Point="0,0" />
                            </PathSegmentCollection>
                        </PathFigure.Segments>
                    </PathFigure>
                </PathFigureCollection>
            </PathGeometry.Figures>
            <PathGeometry.Transform>
                <RotateTransform Angle="225"/>
            </PathGeometry.Transform>
        </PathGeometry>
    </Canvas.Resources>
    <Path Data="{StaticResource pg}" RenderTransformOrigin="0,0">
        <Path.Effect>
            <DropShadowEffect Color="#8B0000" Opacity="0.75" ShadowDepth="0"/>
        </Path.Effect>
        <Path.Fill>
            <RadialGradientBrush>
                <GradientStop Color="#008B0000" Offset="0.0"/>
                <GradientStop Color="#908B0000" Offset="0.5" x:Name="gs"/>
                <GradientStop Color="#FF8B0000" Offset="1.0"/>
            </RadialGradientBrush>
        </Path.Fill>
        <Path.RenderTransform>
            <ScaleTransform x:Name="st" ScaleX="1.0" ScaleY="1.0"/>
        </Path.RenderTransform>
        <Path.Triggers>
            <EventTrigger RoutedEvent="Path.Loaded">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetName="gs" Storyboard.TargetProperty="Offset" To="0.6" Duration="0:0:0.8" AccelerationRatio="0.2" DecelerationRatio="0.8" AutoReverse="True" RepeatBehavior="Forever"/>
                        <DoubleAnimation Storyboard.TargetName="st" Storyboard.TargetProperty="ScaleX" To="1.5" Duration="0:0:0.8" AccelerationRatio="0.2" DecelerationRatio="0.8" AutoReverse="True" RepeatBehavior="Forever"/>
                        <DoubleAnimation Storyboard.TargetName="st" Storyboard.TargetProperty="ScaleY" To="1.5" Duration="0:0:0.8" AccelerationRatio="0.2" DecelerationRatio="0.8" AutoReverse="True" RepeatBehavior="Forever"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </Path.Triggers>
    </Path>
</Canvas>

[WPF,XAML] 跳动的心

原文:https://www.cnblogs.com/lonelyxmas/p/10605414.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!