首页 > 其他分享 >WPF Path Geometry PathFigureCollection PathFigure PathFigure.Segments PolyQuadraticBezierSegment

WPF Path Geometry PathFigureCollection PathFigure PathFigure.Segments PolyQuadraticBezierSegment

时间:2024-05-28 23:00:55浏览次数:21  
标签:PathFigure Geometry PathFigureCollection Segments Path WPF

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

 

标签:PathFigure,Geometry,PathFigureCollection,Segments,Path,WPF
From: https://www.cnblogs.com/Fred1987/p/18219163

相关文章

  • Games101-6 Geometry
    implicit--隐式几何explicit--显示几何implicit点不需要知道位置,但是可以用点之间的关系表示(按照类别归类)E.g.allpointsin3D,where$x2+y2+z^2=1$更通用的表示$f(x,y,z)=0$劣势:不直观优势:可以很简单的判断一个点是否再物体内或者外。explicit......
  • GeometryCollection 的类型映射器(TypeHandler)
    byemanjusakafromhttps://www.emanjusaka.top/2024/05/mybatis-typeHandler-geometryCollection彼岸花开可奈何本文欢迎分享与聚合,全文转载请留下原文地址。GeometryCollection是GeoJSON数据模型中的一个类型,用于表示一个几何对象的集合。MySQL8中支持了GeometryCol......
  • 【智应数】High Dimensional Geometry
    HighdimensiongeometryissurprisinglydifferentfromlowdimensionalgeometryExample1:Volumeconcentratesonshell.Example2:As\(d\rightarrow\infty\),theareaandthevolumnof\(d\)-dimensionalunitball\(\rightarrow\infty\).......
  • 【THREE.js源码】Geometry和Attribute
    BufferAttributeBufferGeometryInstancedBufferAttributeInstancedBufferGeometryInstancedInterleavedBufferInterleavedBufferInterleavedBufferAttributeTHREE.js中有一个重要的类,Mesh,即网格体对象。这个网格体对象在构造的时候需要传入两个变量,geometry和material,geo......
  • Geometry
    一、几何对象模型概述    独立于计算机平台之外的、天然适用于分布式计算的、统一使用建模语言表示的一种对象模型。几何对象模型类图如下:二、几何对象模型分类    几何对象模型大致可以分为3类:简单数据模型、集合数据模型、曲线和曲面数据模型1、简单数......
  • three.js基础之几何体Curve、Geometry
    CurveEllipseCurve<canvasid="EllipseCurve"width="300px"height="200px"></canvas><canvasid="ArcCurve"width="300px"height="200px"></canvas><canvasid="Curv......
  • WPF Storyboary DoubleAnimationUsingPath PathGeometry
    <Windowx:Class="WpfApp30.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.......
  • 【OpenREALM学习笔记:4】geometry_msgs和tf在项目中的不同作用
    geometry_msgsgeometry_msgs是ROS中用于表示几何信息的消息包。它包含了多种消息类型,用于描述点、向量、变换、姿态(位置和方向)、形状等几何概念。geometry_msgs中的消息类型通常用于在ROS节点之间传递几何数据,例如:geometry_msgs/Point:表示三维空间中的一个点。geometry_......
  • GAMES01 Geometry
    生活中有许多曲面、曲线需要去表示。这里也有许多表示几何的方法:Implicitalgebraicsurfacelevelsetsdistancefunctions...Explicitpointcloudpolygonmeshsubdivision,NURBS...Implicit表达通常,隐式表达被定义为f(x,y,z)=0,其中f(x,y,z)是一个xyz的关系表达式......
  • Lecture 11 Geometry 2 (Curves and Surfaces)
    Lecture11Geometry2(CurvesandSurfaces)Curves曲线BézierCurves贝塞尔曲线用一系列控制点定义摸一个曲线,这些控制点会定义曲线满足的一些性质图中通过三个控制点,可以定义曲线起始点和结束点一定在\(p_0\)和\(p_3\)上,并且起始的切线和结束的切线一定都是\(p_0p_1\)......