use*_*942 6 wpf alpha brush textblock opacity
我有一个TextBlock和一个Rectangle,它们都位于一个空的WPF4窗口中.TextBlock的Foreground和Rectangle的Fill都设置为值为#80800000的SolidColorBrush.
这就是它的样子:

Rectangle的颜色是正确的(50%透明栗色),但TextBlock呈现平坦的灰色.这是怎么回事?
编辑:这是XAML:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TextBlock Foreground="#80800000" Height="100" HorizontalAlignment="Left" Margin="47,39,0,0" Text="TextBlock" VerticalAlignment="Top" Width="266" FontFamily="Arial" FontWeight="Bold" FontSize="56" />
<Rectangle Fill="#80800000" Height="100" HorizontalAlignment="Left" Margin="71,174,0,0" Stroke="{x:Null}" VerticalAlignment="Top" Width="200" />
</Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
816 次 |
| 最近记录: |