title: How can I scale up the hatchstyle drawn in a rectangle?
body: <p>I'm using .Net drawing to draw a diagram. It is essentially a stacked bar chart.
  The issue I have is that I want to reduce the amount of lines in the hatch style so in a way scale it up to make it clearer. I've looked around but didn't come across anything that could help me. </p>
  
  <p>I draw a rectangle and then use a hatchbrush to fill it but due to image size the hatchfill becomes less clearer. Thank you for any suggestions.</p>
  
  <p>The hatchStyles and brush types are stored in the db and I use a helper function to return them. So I draw the rectangle and after getting the brush I fill the rectangle. Essentially I want to scale up the hatch fill if that can be done. </p>
  
  <pre><code> g.DrawRectangle(gridpen, startX, startY, BOREHOLE_RECT_WIDTH, layerRectHeight);
  
   brush = GetBoreholeBrush(l.SoilTypeMatrixLevel1Id.PrimaryBrushType,
                            l.SoilTypeMatrixLevel1Id.PrimaryFillStyle, 
                            l.SoilTypeMatrixLevel1Id.PrimaryColour);
  
   g.FillRectangle(brush, startX, startY, BOREHOLE_RECT_WIDTH, layerRectHeight);
  </code></pre>
  
  <p>And the getBrush function; the brush type, hatch style and colour are stored in the db and used to create the returned brush:</p>
  
  <pre><code>    //===================================
      private Brush GetBoreholeBrush(string BrushType, string HatchStyle, string Colour)
      //===================================
      {
          //Decide on what brush type has been chosen.
          Brush brush;
          if (BrushType.ToLower() == BrushTypes.HatchBrush.ToString().ToLower())
          {
              brush = new HatchBrush(GetHatchStyle(HatchStyle), 
                                     Color.Black, ColorTranslator.FromHtml(Colour));
          }
          else if (BrushType.ToLower() == BrushTypes.SolidBrush.ToString().ToLower())
          {
              brush = new HatchBrush(GetHatchStyle(HatchStyle), 
                                     Color.Black, ColorTranslator.FromHtml(Colour));
          }
          else if (BrushType.ToLower() == BrushTypes.TextureBrush.ToString().ToLower())
          {
              brush = new HatchBrush(GetHatchStyle(HatchStyle), 
                                     Color.Black, ColorTranslator.FromHtml(Colour));
          }
          else
          {
              brush = new HatchBrush(GetHatchStyle(HatchStyle), 
                                     Color.Black, ColorTranslator.FromHtml(Colour));
          }
  
          return brush;
      }
  </code></pre>
  
  <p>Function to return the hatch style:</p>
  
  <pre><code>   //===================================
      private HatchStyle GetHatchStyle(string FillStyle)
      //===================================
      {
          //Loop through each hatch tyle and return the correct one.
          foreach (HatchStyle style in Enum.GetValues(typeof(HatchStyle)))
          {
              if (style.ToString().ToLower() == FillStyle.ToLower())
              {
                  return style;
              }
          }
          return HatchStyle.Vertical;
      }
  </code></pre>
  
  <p>As you can see in the image below the hatch style is not clear.</p>
  
  <p><a href="https://i.stack.imgur.com/qOZlO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qOZlO.jpg" alt="enter image description here"></a></p>