WPF Path Geometry PathFigureCollection PathFigure PathFigure.Segments PolyQuadraticBezierSegment

复制代码
<Window x:Class="WpfApp118.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp118"
        mc:Ignorable="d" WindowState="Maximized"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Path Stroke="Black" StrokeThickness="10">
            <Path.Data>
                <PathGeometry>
                    <PathGeometry.Figures>
                        <PathFigure IsClosed="True" StartPoint="10,100">
                            <LineSegment Point="100,100"/>
                            <LineSegment Point="100,50"/> 
                        </PathFigure>
                        <PathFigure IsClosed="True" StartPoint="100,200">
                            <LineSegment Point="100,300"/>
                            <LineSegment Point="200,300"/>
                        </PathFigure>
                        <PathFigure StartPoint="800,800">
                            <PathFigure.Segments>
                                <PathSegmentCollection>
                                    <ArcSegment Size="30,30" RotationAngle="25" IsLargeArc="False"
                                                SweepDirection="Counterclockwise"/>
                                </PathSegmentCollection>
                            </PathFigure.Segments>
                        </PathFigure>
                    </PathGeometry.Figures> 
                </PathGeometry> 
            </Path.Data>
        </Path>
        <Path Stroke="Black" StrokeThickness="1">
            <Path.Data>
                <PathGeometry>
                    <PathGeometry.Figures>
                        <PathFigureCollection>
                            <PathFigure StartPoint="900,1200">
                                <PathFigure.Segments>
                                    <PathSegmentCollection>
                                        <ArcSegment Size="100,50" RotationAngle="45" IsLargeArc="True" 
                                                    SweepDirection="CounterClockwise" Point="200,100" />
                                    </PathSegmentCollection>
                                </PathFigure.Segments>
                            </PathFigure>
                        </PathFigureCollection>
                    </PathGeometry.Figures>
                </PathGeometry>
            </Path.Data>
        </Path>
        <Path Stroke="Red" StrokeThickness="5">
            <Path.Data>
                <PathGeometry>
                    <PathGeometry.Figures>
                        <PathFigureCollection>
                            <PathFigure StartPoint="10,100">
                                <PathFigure.Segments>
                                    <PathSegmentCollection>
                                        <BezierSegment Point1="100,0"
                                                       Point2="200,200"
                                                       Point3="300,100"/>
                                    </PathSegmentCollection>
                                </PathFigure.Segments>
                            </PathFigure>
                        </PathFigureCollection>
                    </PathGeometry.Figures>
                </PathGeometry>
            </Path.Data>
        </Path>
        <Path Stroke="Green" StrokeThickness="5">
            <Path.Data>
                <PathGeometry>
                    <PathGeometry.Figures>
                        <PathFigureCollection>
                            <PathFigure StartPoint="700,700">
                                <PathFigure.Segments>
                                    <QuadraticBezierSegment Point1="1200,1200"
                                                            Point2="1300,700"/>
                                </PathFigure.Segments>
                            </PathFigure>
                        </PathFigureCollection>
                    </PathGeometry.Figures>
                </PathGeometry>
            </Path.Data>
        </Path>
        <Path Stroke="Yellow" StrokeThickness="5">
            <Path.Data>
                <PathGeometry>
                    <PathGeometry.Figures>
                        <PathFigureCollection>
                            <PathFigure StartPoint="900,1200">
                                <PathFigure.Segments>
                                    <PolyQuadraticBezierSegment  Points="200,200 300,100 0,200 30,400" />
                                </PathFigure.Segments>
                            </PathFigure>
                        </PathFigureCollection>
                    </PathGeometry.Figures>
                </PathGeometry>
            </Path.Data>
        </Path>
    </Grid>
</Window>
复制代码

 

posted @   FredGrit  阅读(15)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
历史上的今天:
2019-05-28 error: open(".vs/ConsoleApp349/v16/Server/sqlite3/db.lock"): Permission denied error: unable to index file
点击右上角即可分享
微信分享提示