Kamlendra Sharma
Kamlendra Sharma

Reputation: 717

Vertical line reducing width at the both Ends

I have a requirement to draw a vertical line shown in Image attached. it has a width of say (1 px) Equal width in the middle but at the Dead ends it shoul look like getting disappeared. I tried with line and border but it does not look like getting disappeared at the dead ends. enter image description here

Upvotes: 0

Views: 49

Answers (2)

brunnerh
brunnerh

Reputation: 185553

Could use a Rectangle with a LinearGradient as its Fill brush.

Upvotes: 1

Chris W.
Chris W.

Reputation: 23290

Something like this;

<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

Upvotes: 2

Related Questions