我想将屏幕的背景颜色从红色更改为绿色,但我也希望颜色随外观效果而变化。 我使用的代码改变了整个屏幕的颜色,但如何显示外部效果? 向外,我的意思是颜色从流动的中心到页面的末尾变化。
<StackPanel x:Name="myStackPanel" Background="Red"
Loaded="Start_Animation">
<StackPanel.Resources>
<Storyboard x:Name="colorStoryboard">
<!-- Animate the background color of the canvas from red to green
over 4 seconds. -->
<ColorAnimation BeginTime="00:00:00" Storyboard.TargetName="myStackPanel"
Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
From="Red" To="Green" Duration="0:0:4" />
</Storyboard>
</StackPanel.Resources>
</StackPanel>
答案 0 :(得分:0)
我认为你是在RadialGradientBrush
之后(你可以叠加然后制作动画)。