[WPF,XAML] 跳动的心

原文:[WPF,XAML] 跳动的心

没什么艺术细胞,原谅,原谅![WPF,XAML] 跳动的心

[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>

上一篇:【ShaderToy】跳动的心❤️


下一篇:Yii2-核心框架代码规范