첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
유용한 소스 코드가 있으면 icodebroker@naver.com으로 보내주시면 감사합니다.
블로그 자료는 자유롭게 사용하세요.

■ Polygon 엘리먼트 : FillRule 속성 사용하기

------------------------------------------------------------------------------------------------------------------------


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"

    Width="800"

    Height="600"

    Title="Polygon 엘리먼트 : FillRule 속성 사용하기"

    FontFamily="나눔고딕코딩"

    FontSize="16">

    <Canvas>

        <Canvas.Resources>

            <Style x:Key="{x:Type Polygon}">

                <Setter Property="Polygon.Fill"            Value="Blue" />

                <Setter Property="Polygon.Stroke"          Value="Black" />

                <Setter Property="Polygon.StrokeThickness" Value="3"     />

                <Setter Property="Polygon.Points"          Value="0 -96, 56, 78, -91 -30, 91 -30, -56 78" />

            </Style>

        </Canvas.Resources>

        <TextBlock Canvas.Left="48" Canvas.Top="24"

            Text="FillRule = EvenOdd" />

        <Polygon Canvas.Left="120" Canvas.Top="168"

            FillRule="EvenOdd" />

        <TextBlock Canvas.Left="288" Canvas.Top="24"

            Text="FillRule = NonZero" />

        <Polygon Canvas.Left="360" Canvas.Top="168"

            FillRule="NonZero" />

    </Canvas>

</Window>

 

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker

댓글을 달아 주세요