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

728x90
반응형

■ DrawingBrush 엘리먼트 : Drawing 속성을 사용해 물고기 브러시 만들기

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


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="DrawingBrush 엘리먼트 : Drawing 속성을 사용해 물고기 브러시 만들기"

    FontFamily="나눔고딕코딩"

    FontSize="16">

    <Grid Margin="10">

        <Grid.Background>

            <DrawingBrush>

                <DrawingBrush.Drawing>

                    <DrawingGroup>

                        <GeometryDrawing Brush="Pink">

                            <GeometryDrawing.Geometry>

                                <RectangleGeometry Rect="0 0 200 100" />

                            </GeometryDrawing.Geometry>

                        </GeometryDrawing>

                        <GeometryDrawing Brush="Aqua">

                            <GeometryDrawing.Pen>

                                <Pen

                                    Brush="Blue"

                                    Thickness="2"

                                    LineJoin="Round" />

                            </GeometryDrawing.Pen>

                            <GeometryDrawing.Geometry>

                                <GeometryGroup>

                                    <PathGeometry>

                                        <PathFigure

                                            IsClosed="True"

                                            IsFilled="True"

                                            StartPoint="200 0">

                                            <BezierSegment

                                                Point1="150 100"

                                                Point2="50 -50"

                                                Point3="0 50" />

                                            <BezierSegment

                                                Point1="50 150"

                                                Point2="150 0"

                                                Point3="200 100" />

                                        </PathFigure>

                                    </PathGeometry>

                                    <EllipseGeometry

                                        Center="35 35"

                                        RadiusX="5"

                                        RadiusY="5" />

                                    <EllipseGeometry

                                        Center="165 85"

                                        RadiusX="5"

                                        RadiusY="5" />

                                </GeometryGroup>

                            </GeometryDrawing.Geometry>

                        </GeometryDrawing>

                    </DrawingGroup>

                </DrawingBrush.Drawing>

            </DrawingBrush>

        </Grid.Background>

    </Grid>

</Window>

 

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

728x90
반응형
Posted by 사용자 icodebroker

댓글을 달아 주세요