Outer glow effect to border

≯℡__Kan透↙ 提交于 2019-11-30 04:42:08

BitmapEffects are no longer supported in .NET 4.0.

From MSDN

Important In the .NET Framework 4 or later, the BitmapEffect class is obsolete. If you try to use the BitmapEffect class, you will get an obsolete exception. The non-obsolete alternative to the BitmapEffect class is the Effect class. In most situations, the Effect class is significantly faster.

It isn't the same thing but you can try with a DropShadowEffect with ShadowDepth close to 0 instead.

Example

<Border Width="180" Height="180" Margin="10" Background="Transparent"
        BorderBrush="White" BorderThickness="2" Opacity="1.0">
    <Border.Effect>
        <DropShadowEffect ShadowDepth="0"
                          Color="White"
                          Opacity="1"
                          BlurRadius="5"/>
    </Border.Effect>
</Border>

Comparison between the BitmapEffects you had and DropShadowEffect above. DropShadowEffect to the right.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!