Alex Smolov
Alex Smolov

Reputation: 1861

Double DropShadowFilters

I would like to apply two DropShadowFilter to an image: white inner and black outer. Here is my code:

<s:BitmapImage>
    <s:filters>
        <s:DropShadowFilter angle="90" alpha="0.5" distance="2" strength="1" color="0x000000" inner="false" blurX="6" blurY="6"/>
        <s:DropShadowFilter angle="90" alpha="0.5" distance="2" strength="1" inner="true" color="0xffffff" blurX="0" blurY="0"/>
    </s:filters>
</s:BitmapImage>    

Instead of the desired result, I'm getting white inner and white outer shadows.

enter image description here

Is it expected behavour? Could we mix two DropShadowFilter in one filters tag?

Upvotes: 0

Views: 71

Answers (1)

David Mear
David Mear

Reputation: 2254

Swap the order of your filters, and you should get the effect you're looking for. Filters apply to the whole visible object, including any existing shadows, so at the moment the white "inner" shadow is falling on some of the existing black outer shadow.

Upvotes: 1

Related Questions