通用Windows应用程序中的投影效果

编程入门 行业动态 更新时间:2024-10-19 22:26:49
本文介绍了通用Windows应用程序中的投影效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在寻找一种仅使用XAML在WPF中添加投影效果的简便方法。我想将其应用于ListView中的元素。

I'm looking for an easy way to add a Drop Shadow effect like in WPF, using XAML only. I would like to apply it for the elements in a ListView.

除了这样的实验,我什么都找不到: blogs.windows/buildingapps/ 2016/09/12 /为uwp创建创造美丽效果/#BIRDSebvmJwAFY5Y.97

I haven't found anything more than experiments like this: blogs.windows/buildingapps/2016/09/12/creating-beautiful-effects-for-uwp/#BIRDSebvmJwAFY5Y.97

似乎需要很多代码-背后。我想避免它。

It seems that it would requiere a lot of code-behind. I would like to avoid it. 

推荐答案

如果您想自己使用Composition API进行操作,确实可以完成很多工作。幸运的是,我们有了一个很棒的社区,而这些开源项目之一就是 UWP社区工具包。该工具包包含一个 DropShadowPanel 控件,它可以为您完成辛苦的工作。

If you want to do it yourself with the Composition API, it's quite some work indeed. Luckily we got a great community, and one of those open source projects is the UWP Community Toolkit. This toolkit contains a DropShadowPanel control that does the hard work for you.

<controls:DropShadowPanel BlurRadius="4.0" ShadowOpacity="0.70" OffsetX="5.0" OffsetY="5.0" Color="Black"> <Image Width="200" Source="Unicorn.png" Stretch="Uniform"/> </controls:DropShadowPanel>

请注意,您必须为此将应用程序版本设置为10.0.14393.0(周年更新)效果。

Note that you'll have to set the app version to 10.0.14393.0 (Anniversary Update) for this effect.

更多推荐

通用Windows应用程序中的投影效果

本文发布于:2023-11-11 06:00:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577577.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   效果   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!