I need to have some drawing (triangle and circle) as one object (to set it as content). Triangle should be filled and circle shouldn't be filled with color. The problem is that EllipseGeometry doesn't have IsFilled property. If I remove Fill property at Path both wouldn't be filled. How can I have filled PathFigure and not filled Ellipse having them both in one Path parent?
<Path Stroke="#FFF633FF"
StrokeThickness="1"
Fill="#FFF633FF">
<Path.Data>
<GeometryGroup>
<EllipseGeometry Center="6,0"
RadiusX="4"
RadiusY="4">
</EllipseGeometry>
<PathGeometry >
<PathGeometry.Figures>
<PathFigure StartPoint="6,-15"
IsClosed="True">
<LineSegment Point="1,-25" />
<LineSegment Point="11,-25" />
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</GeometryGroup>
</Path.Data>
</Path>
A simple trick would be to replace the EllipseGeometry by a non-filled PathGeometry with two ArcSegments:
<PathGeometry >
<PathGeometry.Figures>
<PathFigure StartPoint="2,0" IsFilled="False">
<ArcSegment Point="10,0" Size="4,4" />
<ArcSegment Point="2,0" Size="4,4" />
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
The whole point of a geometry is to describe a shape. Stroke and fill are always taken from the owning Path since the Path is responsible for drawing the shape. So what you're asking is not possible. You need to use two Paths here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With