Welcome to our Microsoft Q&A platform!
Q1:
Do you want to get the property of VisualBrush?
Q2:
see the following MSDN link
Q3:
learn about how-to-scale-an-element
Thanks.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hi
i'm creating a lib of hatch patterns as VisualBrush as a resource dictionary,
every things goes well so far, i have some questions ,
here is my code:
<VisualBrush
x:Key="VisualBrush.Hatch.Fill"
TileMode="Tile"
Viewbox="0,0,15,15"
ViewboxUnits="Absolute"
Viewport="0,0,15,15"
ViewportUnits="Absolute">
<VisualBrush.Visual>
<Grid Background="Transparent">
<Path Data="M 0 15 L 15 0" Stroke="Gray" />
<Path Data="M 0 0 L 15 15" Stroke="Gray" />
</Grid>
</VisualBrush.Visual>
</VisualBrush>
<VisualBrush
x:Key="VisualBrush.Hatch.Clay"
TileMode="Tile"
Viewbox="0,0,15,15"
ViewboxUnits="Absolute"
Viewport="0,0,15,15"
ViewportUnits="Absolute">
<VisualBrush.Visual>
<Grid Background="Transparent">
<Path Data="M 0 15 L 15 0" Stroke="Gray" />
</Grid>
</VisualBrush.Visual>
</VisualBrush>
<VisualBrush
x:Key="VisualBrush.Hatch.Silt"
TileMode="Tile"
Viewbox="0,0,10,10"
ViewboxUnits="Absolute"
Viewport="0,0,10,10"
ViewportUnits="Absolute">
<VisualBrush.Visual>
<Grid Background="Transparent">
<Path
Data="M 5 0 L 0 5"
Stroke="Black"
StrokeThickness="0.5" />
</Grid>
</VisualBrush.Visual>
</VisualBrush>
Q1: i want to do something similar to Style(or template) to extract the repeated (below) code out of each pattern.
// repeated code
TileMode="Tile"
Viewbox="0,0,15,15"
ViewboxUnits="Absolute"
Viewport="0,0,15,15"
ViewportUnits="Absolute"
Q2: i want to know what is the are the Viewport/ViewBox and what is the difference .
Q3: i want to know how to scale the pattern instead of define another one .
thanks in advance
Welcome to our Microsoft Q&A platform!
Q1:
Do you want to get the property of VisualBrush?
Q2:
see the following MSDN link
Q3:
learn about how-to-scale-an-element
Thanks.