wpf - 编码 WPF 路径数据

标签 wpf path

在 WPF 中,是否可以将其编码为具有 Data 属性的单个 Path 标记?

<Path Stroke="White" StrokeThickness="2">
    <Path.Data>
        <PathGeometry>
            <PathFigure StartPoint="7,32">
                <ArcSegment Point="7,18" Size="200,50" RotationAngle="0" IsLargeArc="False" />
            </PathFigure>
        </PathGeometry>
    </Path.Data>
</Path>

像这样:(只有这个是完全错误的形状)

<Path Stroke="DarkGoldenRod" StrokeThickness="3" 
Data="M 100,200 C 100,25 400,350 400,175 H 280" />

最佳答案

试试这个:

<Path Data="M 7,32 A 200,50 0 0 0 7,18" .../>

另见 Path Markup Syntax .

关于wpf - 编码 WPF 路径数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5196536/

相关文章:

windows - 如何在 matlab 中访问 windows 相对路径(例如 %userprofile%)?

dynamic - 将构建参数传递给 .wxs 文件以动态构建 wix 安装程序

c# - 依赖注入(inject)和 Entity Framework

c# - WPF 上的嵌套网格问题

c# - WPF 数据网格 "EditItem is not allowed for this view"异常

python - QFileDialog 和路径中的德语元音变音

wpf - 将只读 GUI 属性推回 ViewModel

c# - 在按钮单击事件中中止长时间运行的线程

ruby - 如何在无环境 Ruby 脚本中指定 ruby​​gems 路径?

WPF : Is it possible to adapt a path size to the layout size, 但还在拉伸(stretch)呢?