3

如何cutted-off在 WPF 中制作边框的单个(右上角)角;类似于这个

4

1 回答 1

4

希望这可以帮到你

<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>

这段代码的效果

在此处输入图像描述

于 2013-09-07T13:00:01.733 回答