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

后端 未结 4 1062
南旧
南旧 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 19:15

    You can do this in XAML using a VisualBrush. As a sample to give you a starting point, here is a blog post that uses VisualBrush to create a hatched brush. It's very close to a grid - and would be fairly easy to convert across.

提交回复
热议问题