How to apply multiple effect on same element

2019-04-21 08:08发布

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

3条回答
叼着烟拽天下
2楼-- · 2019-04-21 08:15

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

查看更多
迷人小祖宗
3楼-- · 2019-04-21 08:24

It might be too late, but helps many people visiting for the answer.

Its possible to achieve multiple effects.

Just enclose the UIElement within another new UIElement(any element for that matter, like a stack panel for example). Then apply effects for both elements.

Two effects applied!

<StackPanel>
    <MediaElement Name="myMedia" Source="Fairytale Dream.wmv" >
        <MediaElement.Effect>
            <ShaderEffectLibrary:BloomEffect />
        </MediaElement.Effect>
    </MediaElement>
    <StackPanel.Effect>
        <ShaderEffectLibrary:ZoomBlurEffect />
    </StackPanel.Effect>
</StackPanel>
查看更多
对你真心纯属浪费
4楼-- · 2019-04-21 08:39

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...

查看更多
登录 后发表回答