Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outer glow effect to border

How to provide the outer glow effect to border?

<Grid Width="200" Height="200">     <Grid.Background>         <RadialGradientBrush Center="0.5,0.5" GradientOrigin="0.5,0.5" RadiusX="0.8" RadiusY="0.8">             <RadialGradientBrush.GradientStops>                 <GradientStop Offset="0" Color="#FF123B5F" />                 <GradientStop Offset="1" Color="#FF001F31" />             </RadialGradientBrush.GradientStops>         </RadialGradientBrush>     </Grid.Background>     <Border Width="180" Height="180" Margin="10" Background="Transparent"             BorderBrush="White" BorderThickness="1">         <Border.BitmapEffect>             <OuterGlowBitmapEffect GlowColor="White" GlowSize="3" Opacity="1" />         </Border.BitmapEffect>     </Border> </Grid> 

I have tried this but it not working

like image 430
Ponraja Avatar asked Jun 20 '12 16:06

Ponraja


People also ask

How do you add a glow effect to a border in CSS?

If we make an element round with border-radius: 50% , then box-shadow will follow suit. We can stack multiple glow effects on an element by giving box-shadow multiple sets of values, separated by commas. The glow effects will be stacked with first on top, last on bottom.

What is the function of outer glow?

The Outer Glow effect is used to add a color border to edges.


1 Answers

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.

enter image description here

like image 160
Fredrik Hedblad Avatar answered Sep 18 '22 09:09

Fredrik Hedblad