2016-07-29 72 views
0

我有要求绘制图中所示的垂直线。它有一个宽度说(1像素)在中间等宽,但在死角它看起来像消失了。我尝试了线条和边框,但它看起来并没有像死路一样消失。 enter image description here 两端的垂直线缩小宽度

回答

1

能使用与一个LinearGradient作为RectangleFill刷。

+0

啊对不起的人,我觉得你有些秒打我,你怎么样只是C/P我的例子到你的,我会删除掉,因为你打我? –

+0

@ChrisW .: T'is好:) –

2

就是这样;

<Rectangle Width="1"> 
    <Rectangle.Fill> 
     <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> 
     <GradientStop Color="DarkGray" Offset="0.75"/> 
     <GradientStop Offset="1"/> 
     <GradientStop Color="DarkGray" Offset="0.25"/> 
     <GradientStop Offset="0"/> 
     </LinearGradientBrush> 
    </Rectangle.Fill> 
</Rectangle> 

enter image description here