使用Path描绘两个图形
代码
<Grid>
<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<Path Stroke="Blue" StrokeThickness="1">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="0,0">
<PolyLineSegment Points="100,0 100,90 55,90 50,100 45,90 0,90 0,0" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
<Path
Margin="5"
Stroke="Red"
StrokeThickness="1">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="5,0">
<LineSegment Point="95,0" />
<ArcSegment
Point="100,5"
Size="5,5"
SweepDirection="Clockwise" />
<LineSegment Point="100,85" />
<ArcSegment
Point="95,90"
Size="5,5"
SweepDirection="Clockwise" />
<PolyLineSegment Points="55,90 50,100 45,90 5,90" />
<ArcSegment
Point="0,85"
Size="5,5"
SweepDirection="Clockwise" />
<LineSegment Point="0,5" />
<ArcSegment
Point="5,0"
Size="5,5"
SweepDirection="Clockwise" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
</StackPanel>
</Grid>
效果