0

I know I know I shouldn't do this but I am so new to WPF and BitmapEffects is less daunting than Effects. SO - I have added a border with bitmapeffects to my window and - no bitmap effects. The border is there but not effects are applying. Any clues?

    <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>

Window Border

Matthew
  • 67
  • 7

1 Answers1

0

It's just not going to work, you have to use Effects instead:

[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);
  }
}
Florin Bratan
  • 155
  • 1
  • 6
  • how do I do this in XAML? – Matthew Oct 26 '19 at 22:04
  • This was just the source code for the BitmapEffect property, unfortunately there isn't any simple solution to replace BevelBitmapEffect. More info: https://social.msdn.microsoft.com/Forums/vstudio/en-US/8fe595fe-dbd1-4dfe-933d-197d3f566adc/alternative-to-bevelbitmapeffect?forum=wpf – Florin Bratan Oct 26 '19 at 22:07
  • the links provided in the MSDN link come up empty... now what? – Matthew Oct 26 '19 at 22:22
  • Basically there is no alternative. You need to use an alternative Shader effect instead, such as DropShadowEffect. – Florin Bratan Oct 26 '19 at 22:38