我将多个用户控件添加到画布。每个控件都有自己的故事板,可以在加载时执行。我注意到它在执行20秒动画时非常波涛汹汹。这不是非常复杂,我预计会有更好的表现。任何我应该寻找的陷阱?这是一个故事板样本:WPF用户控件与故事板动画是生涩/杂乱
<Storyboard x:Key="mystoryboard" RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(BlurEffect.Radius)" Storyboard.TargetName="itemgroup">
<SplineDoubleKeyFrame KeyTime="0" Value="30"/>
<SplineDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
<SplineDoubleKeyFrame KeyTime="0:0:8" Value="0"/>
<SplineDoubleKeyFrame KeyTime="0:0:10" Value="30"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="itemgroup">
<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
<SplineDoubleKeyFrame KeyTime="0:0:2" Value="0.96"/>
<SplineDoubleKeyFrame KeyTime="0:0:4" Value="1"/>
<SplineDoubleKeyFrame KeyTime="0:0:7" Value="1"/>
<SplineDoubleKeyFrame KeyTime="0:0:8" Value="1"/>
<SplineDoubleKeyFrame KeyTime="0:0:10" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="itemgroup">
<SplineDoubleKeyFrame KeyTime="0" Value="0.1"/>
<SplineDoubleKeyFrame KeyTime="0:0:10" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="itemgroup">
<SplineDoubleKeyFrame KeyTime="0" Value="0.1"/>
<SplineDoubleKeyFrame KeyTime="0:0:10" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="itemgroup">
<SplineDoubleKeyFrame KeyTime="0" Value="-60"/>
<SplineDoubleKeyFrame KeyTime="0:0:10" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
注意您的系统资源,看看它是否固定了CPU。另外,更新你的vidya驱动程序。 – Will 2011-04-20 19:28:21
它肯定会增加CPU,但它是我做错了什么的B/C? – 2011-04-20 20:13:05
很难分辨。可能与样条的行为有关。你应该在一个测试项目中尝试一个非常简化的版本,看看一个单一的控制动画是否表现出相同的行为。 – Will 2011-04-20 20:53:42