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

728x90
반응형
728x170

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 엘리먼트 : GeometryDrawing 객체를 사용해 체크 배경 브러시 만들기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Grid Margin="10">
        <Border
            BorderBrush="Gray"
            BorderThickness="1">
            <Rectangle>
                <Rectangle.Fill>
                    <DrawingBrush
                        Viewport="0 0 10 10"
                        ViewportUnits="Absolute"
                        TileMode="Tile">
                        <DrawingBrush.Drawing>
                            <DrawingGroup>
                                <GeometryDrawing
                                    Brush="White">
                                    <GeometryDrawing.Geometry>
                                        <RectangleGeometry Rect="0 0 1 1" />
                                    </GeometryDrawing.Geometry>
                                </GeometryDrawing>
                                <GeometryDrawing>
                                    <GeometryDrawing.Brush>
                                        <SolidColorBrush Opacity="0.4">
                                            <SolidColorBrush.Color>
                                                <Color
                                                    A="102"
                                                    R="204"
                                                    G="204"
                                                    B="204" />
                                            </SolidColorBrush.Color>                                
                                        </SolidColorBrush>
                                    </GeometryDrawing.Brush>
                                    <GeometryDrawing.Geometry>
                                        <GeometryGroup>
                                            <RectangleGeometry Rect="0 0 0.5 0.5 "    />
                                            <RectangleGeometry Rect="0.5 0.5 0.5 0.5" />
                                        </GeometryGroup>
                                    </GeometryDrawing.Geometry>
                                </GeometryDrawing>
                            </DrawingGroup>
                        </DrawingBrush.Drawing>
                    </DrawingBrush>
                </Rectangle.Fill>
            </Rectangle>
        </Border>
    </Grid>
</Window>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요