Border also defines BitmapEffect. I have already discussed about OuterGlowBitmapEffect and BevelBitmapEffect, so lets discuss about the rest.
1. EmbossBitmapEffect:
This effect will emboss the whole border. The LightAngle specifies the angular direction of light placed on the border. So if you write somethinginside the Border, it would have a shadow effect automatically just like the below :
If you see the code it looks like :
<Border Background="AliceBlue" Width="100" Height="100" CornerRadius="5"BorderBrush="Black" BorderThickness="2">
<Border.BitmapEffect>
<EmbossBitmapEffect LightAngle="270" Relief=".4" /></Border.BitmapEffect><TextBlock HorizontalAlignment="Center" Foreground="Gold"FontSize="20" VerticalAlignment="Center" Text="This is Embossed"TextWrapping="Wrap" TextTrimming="WordEllipsis"/>
</Border>The Text inside the textblock is Embossed with the whole border itself.
2. DropShadowBitmapEffect : You can also specify dropshadow usingBitmapEffect. It allows to add Noise to it as well.
The code will look like :
<DropShadowBitmapEffect Color="Red" Direction="200" Noise=".6"ShadowDepth="10" Opacity=".6"/> This is same as normal DropShadowEffect but a bit of enhancements.For BitmapEffects you can also add all the effects at a time using BitmapEffectGroup.
1. EmbossBitmapEffect:
This effect will emboss the whole border. The LightAngle specifies the angular direction of light placed on the border. So if you write somethinginside the Border, it would have a shadow effect automatically just like the below :
If you see the code it looks like :
<Border Background="AliceBlue" Width="100" Height="100" CornerRadius="5"BorderBrush="Black" BorderThickness="2">
<Border.BitmapEffect>
<EmbossBitmapEffect LightAngle="270" Relief=".4" /></Border.BitmapEffect><TextBlock HorizontalAlignment="Center" Foreground="Gold"FontSize="20" VerticalAlignment="Center" Text="This is Embossed"TextWrapping="Wrap" TextTrimming="WordEllipsis"/>
</Border>The Text inside the textblock is Embossed with the whole border itself.
2. DropShadowBitmapEffect : You can also specify dropshadow usingBitmapEffect. It allows to add Noise to it as well.
The code will look like :
<DropShadowBitmapEffect Color="Red" Direction="200" Noise=".6"ShadowDepth="10" Opacity=".6"/> This is same as normal DropShadowEffect but a bit of enhancements.For BitmapEffects you can also add all the effects at a time using BitmapEffectGroup.


No comments:
Post a Comment