How to apply multiple effect on same element

丶灬走出姿态 提交于 2019-12-05 02:49: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

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>

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!