728x90
반응형
728x170
■ GeometryGroup 엘리먼트의 FillRule 속성을 사용하는 방법을 보여준다.
▶ MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="TestProject.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Path
HorizontalOptions="Center"
VerticalOptions="Center"
WidthRequest="300"
HeightRequest="300"
StrokeThickness="10"
Stroke="Black"
Fill="#ccccff"
Aspect="Fill">
<Path.Data>
<GeometryGroup FillRule="Nonzero">
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="120,120">
<PathFigure.Segments>
<PathSegmentCollection>
<ArcSegment
Point="140,120"
Size="50,50"
IsLargeArc="True"
SweepDirection="CounterClockwise" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
<PathFigure StartPoint="120,100">
<PathFigure.Segments>
<PathSegmentCollection>
<ArcSegment
Point="140,100"
Size="70,70"
IsLargeArc="True"
SweepDirection="CounterClockwise" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
<PathFigure StartPoint="120,70">
<PathFigure.Segments>
<PathSegmentCollection>
<ArcSegment
Point="140,70"
Size="100,100"
IsLargeArc="True"
SweepDirection="CounterClockwise" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
<PathFigure StartPoint="120,300">
<PathFigure.Segments>
<ArcSegment
Point="140,300"
Size="130,130"
IsLargeArc="True"
SweepDirection="Clockwise" />
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</GeometryGroup>
</Path.Data>
</Path>
</ContentPage>
※ 프리뷰 버전 테스트시, Path 엘리먼트가 설정된 크기대로 표시되지 않고 화면 전체를 채운 상태로 표시되었다. 디버깅 모드에서 Path 엘리먼트의 WidthRequest/HeightRequest 속성을 반복적으로 변경하면 표시가 정상적으로 되었다.
※ 프리뷰 버전 테스트시, GeometryGroup 엘리먼트의 FillRule 속성을 Nonzero로 설정했으나 적용되지 않는 것 같다.
728x90
반응형
그리드형(광고전용)
'C# > MAUI' 카테고리의 다른 글
[C#/MAUI/.NET6] ArcSegment 엘리먼트 사용하기 (0) | 2022.05.17 |
---|---|
[C#/MAUI/.NET6] PathGeometry 엘리먼트 사용하기 (0) | 2022.05.17 |
[C#/MAUI/.NET6] RectangleGeometry 엘리먼트 : Rect 속성 사용하기 (0) | 2022.05.17 |
[C#/MAUI/.NET6] LineGeometry 엘리먼트 : StartPoint/EndPoint 속성 사용하기 (0) | 2022.05.17 |
[C#/MAUI/.NET6] EllipseGeometry 엘리먼트 사용하기 (0) | 2022.05.17 |
[C#/MAUI/.NET6] GeometryGroup 엘리먼트 : FillRule 속성 사용하기 (프리뷰 버전 오류) (0) | 2022.05.16 |
[C#/MAUI/.NET6] Polyline 엘리먼트 : StrokeLineJoin 속성 사용하기 (0) | 2022.05.16 |
[C#/MAUI/.NET6] Line 엘리먼트 : StrokeLineCap 속성 사용하기 (0) | 2022.05.16 |
[C#/MAUI/.NET6] Rectangle 엘리먼트 : StrokeThickness/StrokeDashOffset/StrokeDashArray 속성 사용하기 (0) | 2022.05.15 |
[C#/MAUI/.NET6] Ellipse 엘리먼트 : Stroke/Fill 속성 사용하기 (0) | 2022.05.15 |
댓글을 달아 주세요