我將多個用戶控件添加到畫布。每個控件都有自己的故事板,可以在加載時執行。我注意到它在執行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