Bac*_*con 3 .net c# wpf xaml expression-blend
我试图在我的WPF应用程序中创建一个形状,该形状具有透明填充但具有纯色笔触。我只看到我绘制的属性Opacity,该属性Path使描边和填充透明。是否可以仅将填充变成透明而不是描边?
编辑:我需要填充为透明颜色,笔触为纯色。
使用SolidColorBrush不透明的填充。
<Rectangle Stroke="Red" Margin="10" StrokeThickness="5" Height="50" Width="100">
<Rectangle.Fill>
<SolidColorBrush Color="Red" Opacity=".5"/>
</Rectangle.Fill>
</Rectangle>
Run Code Online (Sandbox Code Playgroud)
如果不需要绑定不透明度或颜色,还可以使用速记:Fill="#80FF0000"前两个字符是alpha值的十六进制代码。
结果:
| 归档时间: |
|
| 查看次数: |
4083 次 |
| 最近记录: |