• WPF圆动画旋转、边框、内容渲染、阴影


        <Grid>
            <Viewbox Margin="20">
                <Ellipse x:Name="ellipse1" Width="150" Height="150" StrokeThickness="10" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True">
                    <Ellipse.Effect>
                        <DropShadowEffect ShadowDepth="0" BlurRadius="50" Color="Blue" />
                    </Ellipse.Effect>
                    <Ellipse.RenderTransform>
                        <RotateTransform x:Name="rotate1" Angle="0" />
                    </Ellipse.RenderTransform>
                    <Ellipse.Triggers>
                        <EventTrigger RoutedEvent="Loaded" SourceName="ellipse1">
                            <EventTrigger.Actions>
                                <BeginStoryboard>
                                    <Storyboard RepeatBehavior="Forever">
                                        <!--Fill-->
                                        <DoubleAnimation Storyboard.TargetName="gs31" Storyboard.TargetProperty="Offset" From="0" To="0.7" Duration="0:0:5" BeginTime="00:00:00" />
                                        <DoubleAnimation Storyboard.TargetName="gs32" Storyboard.TargetProperty="Offset" From="0" To="0.7" Duration="0:0:5" BeginTime="00:00:00" />
                                        <DoubleAnimation Storyboard.TargetName="gs41" Storyboard.TargetProperty="Offset" From="0.014" To="0.714" Duration="0:0:5" BeginTime="00:00:0" />
                                        <DoubleAnimation Storyboard.TargetName="gs42" Storyboard.TargetProperty="Offset" From="0.014" To="0.714" Duration="0:0:5" BeginTime="00:00:0"  />
                                        <DoubleAnimation Storyboard.TargetName="gs31" Storyboard.TargetProperty="Offset" From="0.7" To="1" Duration="0:0:5" BeginTime="00:00:05" />
                                        <DoubleAnimation Storyboard.TargetName="gs32" Storyboard.TargetProperty="Offset" From="0.7" To="1" Duration="0:0:5" BeginTime="00:00:05" />
                                        <DoubleAnimation Storyboard.TargetName="gs41" Storyboard.TargetProperty="Offset" From="0.714" To="1" Duration="0:0:4.77" BeginTime="00:00:5" />
                                        <DoubleAnimation Storyboard.TargetName="gs42" Storyboard.TargetProperty="Offset" From="0.714" To="1" Duration="0:0:4.77" BeginTime="00:00:5"  />
                                        <!--Stroke-->
                                        <DoubleAnimation Storyboard.TargetName="gs51" Storyboard.TargetProperty="Offset" From="0" To="0.7" Duration="0:0:5" BeginTime="00:00:00" />
                                        <DoubleAnimation Storyboard.TargetName="gs52" Storyboard.TargetProperty="Offset" From="0" To="0.7" Duration="0:0:5" BeginTime="00:00:00" />
                                        <DoubleAnimation Storyboard.TargetName="gs61" Storyboard.TargetProperty="Offset" From="0.014" To="0.714" Duration="0:0:5" BeginTime="00:00:00" />
                                        <DoubleAnimation Storyboard.TargetName="gs62" Storyboard.TargetProperty="Offset" From="0.014" To="0.714" Duration="0:0:5" BeginTime="00:00:00"  />
                                        <DoubleAnimation Storyboard.TargetName="gs51" Storyboard.TargetProperty="Offset" From="0.7" To="1" Duration="0:0:5" BeginTime="00:00:5" />
                                        <DoubleAnimation Storyboard.TargetName="gs52" Storyboard.TargetProperty="Offset" From="0.7" To="1" Duration="0:0:5" BeginTime="00:00:5" />
                                        <DoubleAnimation Storyboard.TargetName="gs61" Storyboard.TargetProperty="Offset" From="0.714" To="1" Duration="0:0:4.77" BeginTime="00:00:5" />
                                        <DoubleAnimation Storyboard.TargetName="gs62" Storyboard.TargetProperty="Offset" From="0.714" To="1" Duration="0:0:4.77" BeginTime="00:00:5"  />
                                        <!--Rotate-->
                                        <DoubleAnimation Storyboard.TargetName="rotate1" Storyboard.TargetProperty="Angle" From="0" To="360" Duration="0:0:10" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                    </Ellipse.Triggers>
                    <Ellipse.Stroke>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                            <GradientStop Offset="0" Color="DarkBlue" />
                            <GradientStop x:Name="gs51" Offset="0" Color="DarkBlue" />
                            <GradientStop x:Name="gs52" Offset="0" Color="Aqua" />
                            <GradientStop x:Name="gs61" Offset="0" Color="Aqua" />
                            <GradientStop x:Name="gs62" Offset="0" Color="DarkBlue" />
                            <GradientStop Offset="1" Color="DarkBlue" />
                        </LinearGradientBrush>
                    </Ellipse.Stroke>
                    <Ellipse.Fill>
                        <RadialGradientBrush>
                            <GradientStop Offset="0" Color="DarkBlue" />
                            <GradientStop x:Name="gs31" Offset="0" Color="DarkBlue" />
                            <GradientStop x:Name="gs32" Offset="0" Color="Aqua" />
                            <GradientStop x:Name="gs41" Offset="0" Color="Aqua" />
                            <GradientStop x:Name="gs42" Offset="0" Color="DarkBlue" />
                            <GradientStop Offset="1" Color="DarkBlue" />
                        </RadialGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>
            </Viewbox>
        </Grid>
  • 相关阅读:
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    Ural 1146 Maximum Sum(DP)
    [算法系列之四]优先级队列
    Python源代码--整数对象(PyIntObject)的内存池
    3星|何帆《猜测与偏见》:社科书评集
    4星|《认识经济》:全面系统的经济学普及读物,鸿篇巨制,价格超贵
    3星|《东方启动点》:民营企业家们的故事,故事多分析概括少
    2星|《大师的管理课》:畅销书作家们的35篇励志散文
    3.5星|《蓝海战略2》:实施蓝海战略的具体工具与方法。案例牵强且偏老旧
    2星|《读懂华为30年》:基于公开资料的整理和肤浅的发挥
  • 原文地址:https://www.cnblogs.com/RedSky/p/6958074.html
Copyright © 2020-2023  润新知