views:

141

answers:

3

How can i set mulitple effect like(shadow and blur) on same element.

A: 

Use the BitmapEffectGroup container:

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;

  <StackPanel>

    <Button Margin="50" Width="300">
      DropShadow Under this Button
      <Button.BitmapEffect>
        <BitmapEffectGroup>
          <BlurBitmapEffect Radius="2" />
          <DropShadowBitmapEffect Color="Black" Direction="320" ShadowDepth="30" Softness="1" 
           Opacity="0.5"/>
        </BitmapEffectGroup>
      </Button.BitmapEffect>
    </Button>

  </StackPanel>

</Page>

Taken from the following MSDN documentation page: http://msdn.microsoft.com/en-us/library/system.windows.media.effects.bitmapeffectgroup.aspx

jrista
Thanx for your reply, but this is the sample of BitmapEffect ans as MS say BitmapEffect has been obsolete, i want to apply multiple effect using Effect property.
Firoz
BitmapEffect being obsolete is news to me. They are not accelerated, and there may be permissions issues for partial-trust apps, but they are still a current and valid API. If you really don't want to use a bitmap effect, then you will probably need to write your own effect...I don't know if anything like an EffectGroup.
jrista
They are considered obsolete, see the version info at http://msdn.microsoft.com/en-us/library/system.windows.uielement.bitmapeffect.aspx
Donnie
A: 

I think there is no need to combine effects here.

One of these effect will help you for simulating other effects like in case of DropShadow Effect, You could use BlurRadius for Blur Effect and ShadowDepth for shadow..

By using appropriate values you could simulate combination effects...

Sasikumar D.R.
+3  A: 

I've just this minute done this. Credit to Greg Schechter for the idea.

You can nest Decorators like a Border and put a different Effect on each. I haven't tried with a large number of Effects yet but so far performance seems good.

Regards David

David Hollinshead