Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF - How to add effects (like Shadow) to a Label

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?

like image 369
Hedge Avatar asked Sep 23 '10 11:09

Hedge


2 Answers

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>
like image 64
Tokk Avatar answered Sep 21 '22 01:09

Tokk


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.

like image 34
Daniel Rose Avatar answered Sep 22 '22 01:09

Daniel Rose