Is possible to draw a Shape that has a background made by slanted lines?
An example with Rectangle (sorry for the image quality):

And if i want dashed lines or change the line properties (stroke, thickness..)?
You can use solution from this article http://mark-dot-net.blogspot.com/2007/06/creating-hatched-patterned-brush-in-wpf.html
<VisualBrush
x:Key="HatchBrush"
TileMode="Tile" Viewport="0,0,10,10"
ViewportUnits="Absolute" Viewbox="0,0,10,10"
ViewboxUnits="Absolute">
<VisualBrush.Visual>
<Canvas>
<Rectangle Fill="Azure" Width="10" Height="10" />
<Path Stroke="Purple" Data="M 0 0 l 10 10" />
</Canvas>
</VisualBrush.Visual>
</VisualBrush>
Just change the parameters etc. to fit your application
Usage:
<Rectangle Width="80" Height="40"
Fill="{StaticResource HatchBrush}"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With