wpf 用于绘制刻度线的路径的数据点

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29888170/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 13:06:28  来源:igfitidea点击:

Data Points for Path to draw a tick mark

wpfxamlstyling

提问by keerthee

Can anyone specify the data points to be used to get a tick mark like the following

任何人都可以指定用于获得如下刻度线的数据点

enter image description here

在此处输入图片说明

I use this

我用这个

<Path Name="TickMark" Fill="Black" Data="M0,4 5,9 9,0 4,5" Visibility="Hidden" />

But doesnt look like the above,It looks like

但看起来不像上面的,它看起来像

enter image description here

在此处输入图片说明

回答by Juan Pablo Garcia Coello

If you need an specific path, I recommend to use Inkscape or Expression Design and try to make by yourself

如果需要具体路径,建议使用Inkscape或Expression Design,自己尝试制作

For this case, I have made it in Inkscape and pasted into Expression Design:

对于这种情况,我在 Inkscape 中制作并粘贴到 Expression Design 中:

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Layer_1" Width="8" Height="9" Canvas.Left="0" Canvas.Top="0">
<Path Width="7.85446" Height="8.57578" Canvas.Left="-0.0522281" Canvas.Top="-0.100391" Stretch="Fill" StrokeThickness="1.04192" StrokeMiterLimit="2.75" Stroke="#FF000000" Data="F1 M 0.468732,4.66838L 3.03345,7.95443L 7.28127,0.420569"/>

Then extract the Data to your Path

然后将数据提取到您的路径

<Path Name="TickMark" Fill="Black" Data="F1 M 0.468732,4.66838L 3.03345,7.95443L 7.28127,0.420569" Visibility="Hidden" />

And just adjust until you like the tick mark

然后调整直到你喜欢刻度线