0

我想为背景页面进行颜色转换,例如从 blue-lightblue-white- 等等。我尝试使用.gif文件,但它在手机上不起作用。我认为也许可以使用更改值RGB或以ARGB编程方式完成,但我不知道如何实现。谁能告诉我怎么做?之前谢谢

4

1 回答 1

2

你可以通过使用故事板来做到这一点。例如:

<phone:PhoneApplicationPage.Resources>
    <Storyboard x:Name="Storyboard1" RepeatBehavior="Forever">
        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="LayoutRoot">
            <DiscreteColorKeyFrame KeyTime="0" Value="Blue"/>
            <DiscreteColorKeyFrame KeyTime="0:0:1" Value="LightBlue"/>
            <DiscreteColorKeyFrame KeyTime="0:0:2" Value="White"/>
            <DiscreteColorKeyFrame KeyTime="0:0:3" Value="White"/>
        </ColorAnimationUsingKeyFrames>
    </Storyboard>
</phone:PhoneApplicationPage.Resources>

加载页面后,您将启动 Storyboard:

this.Storyboard1.Begin();
于 2013-03-12T08:55:32.793 回答