我有這個畫布在我的XAML定義的RenderTransform需要太多的CPU
<Canvas Width="128" Height="128" Margin="10">
<Canvas.CacheMode>
<BitmapCache />
</Canvas.CacheMode>
<Canvas.Triggers>
<EventTrigger RoutedEvent="Canvas.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
From="0" To="360"
RepeatBehavior="Forever"
Storyboard.TargetName="spin"
Storyboard.TargetProperty="(RotateTransform.Angle)"
/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Canvas.Triggers>
<Canvas.RenderTransform>
<RotateTransform x:Name="spin" Angle="0" CenterX="64" CenterY="64" />
</Canvas.RenderTransform>
<Image Source="Images\CircularLoading.png" Width="128" Height="128" />
</Canvas>
這個動畫把我的CPU的50%,我怎麼能提高性能?
如果你正在做的是旋轉圖像,也許動畫GIF會更好(預先計算的圖像總是拍計算圖像)。 [這](http://stackoverflow.com/questions/210922/how-do-i-get-an-animated-gif-to-work-in-wpf)問題和答案可能會有所幫助。 –