Blog Content

    티스토리 뷰

    30.SilverLight3 - Brush : LinearGradientBrush

    반응형
    LinearGradientBrush
    - 선형 그라에이션


    MainPage.xaml

    [그림 30-1]


    <Grid x:Name="LayoutRoot" Background="White">

            <Rectangle Width="100" Height="100">

                <Rectangle.Fill>

                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">

                        <GradientStop Color="Red" Offset="0.0"></GradientStop>

                        <GradientStop Color="Yellow" Offset="0.35"></GradientStop>

                        <GradientStop Color="Blue" Offset="0.75"></GradientStop>

                    </LinearGradientBrush>

                </Rectangle.Fill>

            </Rectangle>

    </Grid>



    응용예제
    FrmLinearGradientBrush.xaml

    [그림 30-2]


    <Grid x:Name="LayoutRoot" Background="White">

            <TextBlock FontFamily="Arial Black" FontSize="50" Text=" ">

                   <TextBlock.Foreground>

                       <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">

                           <GradientStop Offset="0" Color="Blue"></GradientStop>

                           <GradientStop Offset="0.5" Color="Green"></GradientStop>

                           <GradientStop Offset="1" Color="Red"></GradientStop>

                       </LinearGradientBrush>

                   </TextBlock.Foreground>

            </TextBlock>

    </Grid>


    반응형

    Comments