如何在WPF中创建边框的单个cutted-off
(右上角);类似于this?
答案 0 :(得分:3)
希望这可以帮到你
<Grid Background="#FF4E7BF5" Width="250" Height="250">
<Grid.Clip>
<GeometryGroup>
<!--This RectangleGeometry will show Grid body-->
<RectangleGeometry Rect="0,0,250,250"/>
<!--This PathGeometry will cut RectangleGeometry, cut-off right top-->
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="230,0">
<LineSegment Point="250,0"/>
<LineSegment Point="250,20"/>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
<!--This PathGeometry will cut RectangleGeometry, cut-of left bottom-->
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="0,230">
<LineSegment Point="0,250"/>
<LineSegment Point="20,250"/>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</GeometryGroup>
</Grid.Clip>
</Grid>
此代码的效果