I have a Label and want to add Shadow to it.
It seems like I can't apply the DropShadowBitmapEffect to it.
What else can I do?
I have a Label and want to add Shadow to it.
It seems like I can't apply the DropShadowBitmapEffect to it.
What else can I do?
The bitmap effects are obsolete since .NET 3.5 (SP1?). Use DropShadowEffect instead.
EDIT: Since the effects are obsolete for a while, in .NET 4.0 they are an empty code block, i.e. do nothing.
Use the DropShadowEffect
instead of the DropShadowBitmapEffect
. Bitmap-Effects are obsolete.
But take care with effects. Use the WPF performance Suite to check the performance-behaviour of the used effects - I already have seen very bad performance impacts by using the effect-classes. See here for an example.
Another option would be to decorate the label with a Border
. If you set the thickness accordingly, this would like a shadow:
<Border BorderThickness="1,1,20,20" BorderBrush="Black">
<Label />
</Border>
(I have not looked how the above border looks like. You have to play around a bit to get a good result).
You can do this for Example:
<Label Content="LabelText:" >
<Label.BitmapEffect>
<DropShadowBitmapEffect Color="Black" Direction="320" ShadowDepth="10" Opacity=".5" Softness="9" />
</Label.BitmapEffect>
</Label>