win8第三步涂刷

win8第三步涂刷

SolidColorBrush 单一颜色填充

LinearGradientBrush渐变涂刷,GradientStop 代表一个颜色

      

win8第三步涂刷
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Button Content="Button" HorizontalAlignment="Left" Margin="71,68,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1.158,-0.553" Height="157" Width="283">
            <Button.Background>
                <!--<SolidColorBrush Color="Gold"></SolidColorBrush>-->
                <LinearGradientBrush>
                    <GradientStop Color="Red" Offset="0"></GradientStop>
                    <GradientStop Color="Yellow" Offset="0.70"></GradientStop>
                    <GradientStop Color="Blue" Offset="1"></GradientStop>
                </LinearGradientBrush>
            </Button.Background>
        </Button>
        <TextBlock HorizontalAlignment="Left" Margin="74,275,0,0" TextWrapping="Wrap" Text="想想大发大地方" FontSize="50" VerticalAlignment="Top" Height="77" Width="427">
            <TextBlock.Foreground>
                <LinearGradientBrush>
                    <GradientStop Color="Red"></GradientStop>
                    <GradientStop x:Name="gs1" Color="Red" Offset="0.1"></GradientStop>
                    <GradientStop x:Name="gs2" Color="Blue" Offset="0.1"></GradientStop>
                    <GradientStop Color="Blue" Offset="1"></GradientStop>
                </LinearGradientBrush>
            </TextBlock.Foreground>
        </TextBlock>

    </Grid>
win8第三步涂刷

如何让文字以歌词的形式走起来

win8第三步涂刷
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            DispatcherTimer time = new DispatcherTimer();
            time.Interval = TimeSpan.FromMilliseconds(100);
            time.Tick+=time_Tick;
            time.Start();
        }

        private void time_Tick(object sender, object e)
        {
            if (gs1.Offset > 1)
            {
                gs1.Offset = 0;
                gs2.Offset = 0;
            }
            else
            {
                gs1.Offset += 0.01;
                gs2.Offset += 0.01;
            }
        }
win8第三步涂刷

win8第三步涂刷,布布扣,bubuko.com

win8第三步涂刷

上一篇:Linux中查看CPU、内存和IO的占用情况


下一篇:myeclipse中无自动提示