WPF - How can I make a brush that paints graph-paper-like squares?

后端 未结 4 1054
南旧
南旧 2020-12-14 18:21

How might I create a brush that paints a regular, repeated grid of 1-unit thick lines spaced evenly in both the horizontal and vertical axes? Imagine graph paper, if you wi

4条回答
  •  一生所求
    2020-12-14 18:56

    I used a 16x16 bitmap with the left and bottom edges black. Then in my window, I set the background to use that, tiled. Here's the XAML (Slightly altered to show up).

    
      
    
    

提交回复
热议问题