What is the Data value of plus sign in Path

故事扮演 提交于 2020-01-23 11:16:07

问题


How to draw plus and minus signs in using data property in Path object.

This is my triangle path object. I need to change it to plus symbol.

<Path x:Name="trianglePath"  Data="M 0 8 H 12 V 15 Z"/>

回答1:


Here, I've created a plus and minus sign which is 10 x 10 pixels using XAML path markup syntax:

<Path Margin="10" Stroke="White" Data="M0,5 H10 M5,5 V10Z"  StrokeThickness="2" Height="10" Width="10" />

<Path Margin="10" Stroke="White" Data="M0,5 H10"  StrokeThickness="2" Height="10" Width="10" />

When experimenting with designing your path drawing, it's helpful to set the path element's height & width first. To better understand XAML path markup syntax, see MSDN.




回答2:


You might find it easier if you draw them out on a piece of graph paper and then label the vertices with the values needed to reach it from the previous one.

Then copy this into your code.



来源:https://stackoverflow.com/questions/3467484/what-is-the-data-value-of-plus-sign-in-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!