title: Creating Diagonal Pattern in WPF
body: <p>I want to create diagonal hatch pattern in WPF. I am using following XAML code to generate it:</p>
  
  <pre class="lang-xml prettyprint-override"><code>  &lt;VisualBrush 
    x:Key="HatchBrushnew" 
    TileMode="Tile" Viewport="0,0,30,30" 
    ViewportUnits="Absolute" Viewbox="0,0,30,30"    
    ViewboxUnits="Absolute"&gt;
          &lt;VisualBrush.Visual&gt;
              &lt;Canvas&gt;
  
                  &lt;Path  Stroke="Gray" StrokeThickness="0.1cm" &gt;
                      &lt;Path.Data&gt;
                          &lt;LineGeometry StartPoint="0,0" EndPoint="30,30" /&gt;
                      &lt;/Path.Data&gt;
                  &lt;/Path&gt;
  
              &lt;/Canvas&gt;
          &lt;/VisualBrush.Visual&gt;
      &lt;/VisualBrush&gt;
  </code></pre>
  
  <p>But the after filling shape with this pattern, I am getting small gap between two lines. Can anyone suggest a way to avoid that small gap?</p>
  
  <p><img src="https://i.stack.imgur.com/uLKSJ.jpg" alt="Generate Output"></p>