첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.

728x90
반응형
728x170

TestProject.zip
0.01MB

▶ 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="Canvas 엘리먼트 : 축구 경기장 만들기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Canvas
        Width="525"
        Height="400"
        Background="#00b000">
        <Canvas Name="pitchCanvas" Canvas.Left="20" Canvas.Top="20">
            <Canvas.RenderTransform>
                <ScaleTransform
                    ScaleX="4"
                    ScaleY="4" />
            </Canvas.RenderTransform>
            <Polygon
                StrokeThickness="1"
                Stroke="White"
                Points="0 0 120 0 120 90 0 90" />
            <Canvas Name="penaltyArea1Canvas" Canvas.Left="0" Canvas.Top="24.85">
                <Polyline
                    StrokeThickness="1"
                    Stroke="White"
                    Points="0 0 16.5 0 16.5 40.3 0 40.3" />
                <Polyline
                    StrokeThickness="1"
                    Stroke="White"
                    Points="0 11 5.5 11 5.5 29.3 0 29.3" />
                <Polyline
                    StrokeThickness="1"
                    Stroke="White"
                    Points="0 16.5 -2.44 16.5 -2.44 23.8 0 23.8" />
                <Ellipse Canvas.Left="2.15" Canvas.Top="11"
                    Width="18.3"
                    Height="18.3"
                    StrokeThickness="1"
                    Stroke="White"
                    Clip="M 14.35 0 h 10 v 20 h -10 Z" />
                <Ellipse Canvas.Left="10.5" Canvas.Top="19.65"
                    Width="1"
                    Height="1"
                    Fill="White" />
            </Canvas>
            <Canvas x:Name="penaltyArea2Canvas" Canvas.Left="120" Canvas.Top="24.85">
                <Canvas.RenderTransform>
                    <ScaleTransform ScaleX="-1.0" />
                </Canvas.RenderTransform>
                <Polyline
                    StrokeThickness="1"
                    Stroke="White"
                    Points="0 0 16.5 0 16.5 40.3 0 40.3" />
                <Polyline
                    StrokeThickness="1"
                    Stroke="White"
                    Points="0 11 5.5 11 5.5 29.3 0 29.3" />
                <Polyline
                    StrokeThickness="1"
                    Stroke="White"
                    Points="0 16.5 -2.44 16.5 -2.44 23.8 0 23.8" />
                <Ellipse Canvas.Left="2.15" Canvas.Top="11"
                    Width="18.3"
                    Height="18.3"
                    StrokeThickness="1"
                    Stroke="White"
                    Clip="M 14.35 0 h 10 v 20 h -10 Z" />
                <Ellipse Canvas.Left="10.5" Canvas.Top="19.65"
                    Width="1"
                    Height="1"
                    Fill="White" />
            </Canvas>
            <Ellipse Canvas.Left="50.5" Canvas.Top="35.5"
                Width="19"
                Height="19"
                Stroke="White" />
            <Line
                X1="60"
                Y1="0"
                X2="60"
                Y2="90"
                StrokeThickness="1"
                Stroke="White" />
        </Canvas>
    </Canvas>
</Window>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요