728x90
반응형
728x170
▶ 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">
<Rectangle Stroke="Black">
<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>
<SolidColorBrush.Color>
<Color
A="255"
R="204"
G="204"
B="255" />
</SolidColorBrush.Color>
</SolidColorBrush>
</GeometryDrawing.Brush>
<GeometryDrawing.Geometry>
<PathGeometry>
<PathFigure>
<PathFigure.Segments>
<PolyLineSegment Points="1 0 1 0.1 0 0.1" />
</PathFigure.Segments>
</PathFigure>
</PathGeometry>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Brush>
<SolidColorBrush>
<SolidColorBrush.Color>
<Color
A="255"
R="204"
G="204"
B="255" />
</SolidColorBrush.Color>
</SolidColorBrush>
</GeometryDrawing.Brush>
<GeometryDrawing.Geometry>
<PathGeometry>
<PathFigure>
<PathFigure.Segments>
<PolyLineSegment Points="0 1 0.1 1 0.1 0" />
</PathFigure.Segments>
</PathFigure>
</PathGeometry>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Grid>
</Window>
728x90
반응형
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] LinearGradientBrush 엘리먼트 : 글래스 효과 브러시 만들기 (0) | 2020.08.25 |
---|---|
[C#/WPF] DrawingBrush 엘리먼트 : GeometryDrawing 객체를 사용해 격자 배경 브러시 만들기 (0) | 2020.08.25 |
[C#/WPF] UIElement 클래스 : PreviewDragOver/PreviewDrop 이벤트를 사용해 파일 드래그 & 드롭 사용하기 (0) | 2020.08.25 |
[C#/WPF] DrawingContext 클래스 : PushOpacity/Pop 메소드 사용하기 (0) | 2020.08.25 |
[C#/WPF] DrawingContext 클래스 : PushOpacity/Pop 메소드 사용하기 (0) | 2020.08.25 |
[C#/WPF] DrawingBrush 엘리먼트 : GeometryDrawing 객체를 사용해 체크 배경 브러시 만들기 (0) | 2020.08.25 |
[C#/WPF] DrawingImage 클래스 : GlyphRunDrawing 객체를 사용해 이미지 만들기 (0) | 2020.08.25 |
[C#/WPF] DrawingImage 클래스 : GeometryDrawing 객체를 사용해 이미지 만들기 (0) | 2020.08.25 |
[C#/WPF] DrawingBrush 클래스 : ImageDrawing 객체를 사용해 브러시 만들기 (0) | 2020.08.25 |
[C#/WPF] DrawingImage 클래스 : ImageDrawing 객체를 사용해 이미지 만들기 (0) | 2020.08.25 |
댓글을 달아 주세요