c# - 用路径数据wpf绘制箭头

标签 c# .net wpf

<分区>

这个箭头的Path.Data值是多少:

enter image description here

最大网格宽度和高度为 18x18

最佳答案

MSDN 的 example default template for an Expander使用 M 0 4 L 4 0 L 8 4 Z

大多数路径以字母 “M” 和 x,y 坐标开头,后跟由字符标识的线段,后跟以空格分隔的参数数字,最后以字母结尾“Z”。所以 M 0 4 L 4 0 L 8 4 Z 表示

  • 从 0,4 开始
  • 画一条线到 4,0
  • 画一条线到 8,4
  • 然后结束路径

我经常使用以下站点作为这种“几何迷你语言”的引用指南:rcosic.wordpress.com/2009/08/11/wpf-geometry-mini-language

  <Path x:Name="CollapsedArrow"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Data="M 0 0 L 4 4 L 8 0 Z">
    <Path.Fill>
      <SolidColorBrush Color="{DynamicResource GlyphColor}" />
    </Path.Fill>
  </Path>
  <Path x:Name="ExpandededArrow"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Visibility="Collapsed"
        Data="M 0 4 L 4 0 L 8 4 Z">

关于c# - 用路径数据wpf绘制箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8476766/

相关文章:

c# - 重用 XmlTextWriter 类

c# - Datagridview 多选不起作用

c# - 将字节数组从 Oracle RAW 转换为 System.Guid?

c# - 按字母顺序添加到 ObservableCollection

.net - 在 .NET (WPF) 应用程序中集成 Qt 小部件

C# 代码覆盖率指标

c# - 异步 TCP 服务器持有套接字但停止监听

.net - JavaScript XML 注释文档

c# - 如何从子页面更改母版页值

WPF:调整项目大小以使所有项目可见