Reputation: 15
How hide half of brush with opacity mask with no path element? I want to make site "transparent".
<Border Height="32" Width="32" x:Name="b1" CornerRadius="50" BorderThickness="3" BorderBrush="Red">
</Border>
<Grid Height="32" Width="16" HorizontalAlignment="Right" x:Name="hideHaf" Background="Blue" >
</Grid>
Default:
I want:
Upvotes: 1
Views: 172
Reputation: 2519
Just in case your primary goal is to draw a vertical half transparent circle. You could do it this way instead of using the Border
:
<Path Width="16" Height="32" Stretch="Fill" Data="M5,0 A5,5,0,0,0,5,10" Stroke="Red" StrokeThickness="3" HorizontalAlignment="Left" VerticalAlignment="Top"/>
Upvotes: 0
Reputation: 7004
You could simply put your border insize the grid, and use the default ClipToBounds="True"
property of the grid to clip the border like this:
<Grid Height="32" Width="16" HorizontalAlignment="Right" x:Name="hideHaf">
<Border Height="32" Width="32" x:Name="b1" CornerRadius="50" BorderThickness="3" BorderBrush="Red"/>
</Grid>
Which produces:
Upvotes: 2