Windows Phone 7 中的效果 (DropShadowEffect)
我注意到 Windows Phone 7 的 Silverlight 中缺少 Effect 属性,因此我进行了一些谷歌搜索,显然由于性能原因它被删除了。我基本上想做这样的事情
<TextBlock ...>
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
并且
<Image ...>
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
</Image>
那么还有其他方法可以在 Windows Phone 7 的 Silverlight 中获得 DropShadowEffect
吗?如果它会在下一个版本中出现,有什么消息吗?
谢谢
I noticed the Effect Property is missing in Silverlight for Windows Phone 7 so I did some googling and apperently it was dropped due to performance reasons. I basically want to do something like this
<TextBlock ...>
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
And
<Image ...>
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
</Image>
So is there some other way to get a DropShadowEffect
in Silverlight for Windows Phone 7? And are there any news if it'll be in the next release?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用图像,您可以简单地在 Photoshop/Gimp 等中创建阴影(对我来说效果很好)并将其另存为 .png。
对于 TextBlock 来说有点困难。例如,创建一个带有阴影的半透明图像,并将 TextBlock 和图像放置在 Canvas 内。更改 Canvas.ZIndex="integer" 附加属性以将它们按特定顺序放置 - 图像必须位于下方。阴影也应该模糊。
缺点是:
With the image you can just simply create a drop shadow in Photoshop/Gimp etc (works well for me) and save it as .png.
With TextBlock it is a bit harder. For instance, create a half-transparent image with the shadow and place both TextBlock and the Image inside the Canvas. Change the Canvas.ZIndex="integer" attached property to place them in a specific order - image has to be underneath. Also shadow should be blurred.
The drawbacks are:
我想要阴影效果,这对我有用。您需要在两个文本块中放置相同的内容(文本块名称除外)。 X 和 Y 是阴影与文本的水平和垂直距离。如果取决于阴影的位置,您也可以使用负数。
I wanted a shadow effect and this worked for me. You need to put same content in both textblocks (except textblock name). X and Y are the horizonatal and vertical distance of shadow from text. You can also use negative numbers if depending on position of shadows.