첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

■ LinearGradientBrush 엘리먼트를 사용해 글래스 효과 브러시를 만드는 방법을 보여준다.

TestProject.zip
다운로드

▶ MainWindow.xaml

<Window x:Class="TestProject.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:o="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
    Width="800"
    Height="600"
    Title="LinearGradientBrush 엘리먼트 : 글래스 효과 브러시 만들기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Window.Resources>
        <GradientStopCollection x:Key="GlassGradientStopCollectionKey"
            o:Freeze="True">
            <GradientStop Color="WhiteSmoke"  Offset="0.2"  />
            <GradientStop Color="Transparent" Offset="0.4"  />
            <GradientStop Color="WhiteSmoke"  Offset="0.5"  />
            <GradientStop Color="Transparent" Offset="0.75" />
            <GradientStop Color="WhiteSmoke"  Offset="0.9"  />
            <GradientStop Color="Transparent" Offset="1"    />
        </GradientStopCollection>
        <LinearGradientBrush x:Key="GlassLinearGradientBrushKey"
            o:Freeze="True"
            StartPoint="0 0"
            EndPoint="1 1"
            Opacity="0.75"
            GradientStops="{StaticResource GlassGradientStopCollectionKey}" />
    </Window.Resources>
    <Grid Margin="10">
        <Ellipse Margin="10"
            Stroke="Black"
            Fill="RoyalBlue" />
        <Ellipse Margin="10"
            Fill="{StaticResource GlassLinearGradientBrushKey}" />
    </Grid>
</Window>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요