【问题标题】:Silverlight Image Button - Image FAR too faded (transparent? Overlayed?)Silverlight 图像按钮 - 图像太褪色(透明?覆盖?)
【发布时间】:2011-06-09 10:45:44
【问题描述】:

我已经知道如何在我的 Silverlight 4 应用程序中将图像添加到我的按钮中,当图像显示在按钮上时,您几乎看不到它。就好像图像不透明度设置得非常低。我尝试将不透明度设置为 100,但没有效果。

什么是dealio?

这是我的 le 按钮代码:

<Button Height="70" HorizontalAlignment="Left" Margin="16,14,0,0" Name="btnNew" VerticalAlignment="Top" Width="85" Click="button1_Click">
        <Button.Background>
            <ImageBrush ImageSource="/images/NewFile-Mono.png"></ImageBrush>
        </Button.Background>
    </Button>

【问题讨论】:

    标签: c# silverlight xaml silverlight-4.0 opacity


    【解决方案1】:

    图像不透明度不是这里的问题,它是默认样式模板,它有一个容器,该容器具有一些不透明度或渐变效果,覆盖在承载图像画笔的容器顶部...您很可能需要编辑Button 的默认模板以使其正常工作...将Button.Content 设置为Image 可能要容易得多

    <Button Height="70" HorizontalAlignment="Left" Margin="16,14,0,0" Name="btnNew" VerticalAlignment="Top" Width="85" Click="button1_Click">
       <Image Source="/images/NewFile-Mono.png"/>
    </Button>
    

    【讨论】:

      猜你喜欢
      • 2017-11-20
      • 2010-10-02
      • 2015-08-12
      • 1970-01-01
      • 1970-01-01
      • 2020-06-11
      • 2016-02-05
      • 2020-05-30
      • 2013-07-21
      相关资源
      最近更新 更多