Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawing arrows with path data wpf [closed]

Tags:

c#

.net

wpf

What is the Path.Data value of this arrow:

enter image description here

Max Grid width and height are 18x18

like image 650
Timur Mustafaev Avatar asked Dec 12 '11 15:12

Timur Mustafaev


1 Answers

MSDN's example default template for an Expander uses M 0 4 L 4 0 L 8 4 Z

Most path's start with the letter "M" and an x,y coordinate, followed by line segments which are identified by a Character followed by space-delminited numbers for parameters, and end with the letter "Z". So M 0 4 L 4 0 L 8 4 Z means

  • start at 0,4
  • draw a Line up to 4,0
  • draw a Line down to 8,4
  • then end the Path

I often use the following site as a reference guide for this "geometry mini language": 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">
like image 165
Rachel Avatar answered Oct 24 '22 16:10

Rachel