Silverlight 4: How to apply multiple effects to an element?

时光毁灭记忆、已成空白 提交于 2019-12-08 01:01:32

问题


We can apply only one effect to an element. Is there any way to apply multiple effects simultaneously to an element? like both DropShadowEffect as well as the BlurEffect ?

Google did not help me much. Any suggestions?


回答1:


I once experienced the same problem; I had to apply a BlurEffect as well as a DropShadowEffect to an image. What I did was this: I applied the BlurEffect to the Image and put that Image into a Grid (which itself is lookless) onto which I could apply the DropShadowEffect:

<Grid>
    <Image ...>
        <Image.Effect>
            <BlurEffect ... />
        </Image.Effect>
    </Image>
    <Grid.Effect>
        <DropShadowEffect ... />
    </Grid.Effect>
</Grid>

Cheers, Alex



来源:https://stackoverflow.com/questions/2932999/silverlight-4-how-to-apply-multiple-effects-to-an-element

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