I was able to create stripe patterns in WPF, but how can I create a pattern like this in XAML? Is there a default similar brush for this in WPF?
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- Xamarin. The name 'authorEntry does not exist
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
You can do it in XAML using
VisualBrush
. You only need to specify Data values for thePath
, for example:XAML
Output
For converting
Image
to Vector graphics (Path) useInkscape
, which is free and very useful. For more information see this link:Vectorize Bitmaps to XAML using Potrace and Inkscape
Edit
For better performance, you may
Freeze()
you Brushes with help ofPresentationOptions
like this:Quote from
MSDN
:Here's another approach, for a different style of hatching: