代码之家  ›  专栏  ›  技术社区  ›  ricky

在WPF中,如何使用路径标记语法绘制复合几何图形?

  •  0
  • ricky  · 技术社区  · 7 年前

    我正试着画一个数字 Path Markup Syntax 具体如下:

    enter image description here

    我在xaml中试过:

    <Path Margin="20" StrokeThickness="1" Fill="Black" Data="M0,0L15,10L0,20ZM5,0L20,10L5,20"></Path>
    

    我得到了这个:

    enter image description here

    那么,正确的语法是什么?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Clemens    7 年前

    绘制两条单线而不是多段线图形:

    <Path Margin="20" Fill="Black" Stroke="Black" StrokeThickness="1"
          StrokeStartLineCap="Round" StrokeEndLineCap="Round"
          Data="M0,0 L15,10 0,20Z M5,0 L20,10 M5,20 L20,10"/>