0

我知道我知道我不应该这样做,但我对 WPF 很陌生,而且 BitmapEffects 没有 Effects 那么令人生畏。所以 - 我在我的窗口中添加了一个带有位图效果的边框 - 没有位图效果。边界在那里,但没有应用效果。有什么线索吗?

    <Border BorderThickness="10" BorderBrush="Red" Padding="10,10,10,10" CornerRadius="5" Margin="5,5,5,5">
        <Border.BitmapEffect>
            <BevelBitmapEffect BevelWidth="6" LightAngle="120"  Relief="1" EdgeProfile="BulgedUp"/>
        </Border.BitmapEffect>
    </Border>

窗口边框

4

1 回答 1

0

它只是行不通,你必须使用 Effects 代替:

[Obsolete("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")]
public BitmapEffect BitmapEffect
{
  get
  {
    return (BitmapEffect) this.GetValue(UIElement.BitmapEffectProperty);
  }
  set
  {
    this.SetValue(UIElement.BitmapEffectProperty, (object) value);
  }
}
于 2019-10-26T22:01:40.333 回答