WPF 中的滚动片尾字幕屏幕...有什么想法吗?
我正在寻找为我的应用程序创建一个(可能是 3D)滚动片尾屏幕,这与您在电影结尾可能看到的类似,但应该能够包含图形、动画等。
最好的方法是什么去做这件事吗? 我想我可以创建一个非常高的 UserControl,其中包含要滚动的整个内容,然后在 ScrollViewer 中对其进行动画处理,甚至只是在 Canvas 中对位置进行动画处理,但是这样做会存在明显的性能问题,而且我恐怕会太慢。
如果制作人员名单可以在 3D 表面上滚动(有点像《星球大战》),或者具有鱼眼效果,那就太酷了,但我知道 WPF 中的 3D 是可以滚动的。
我确实想要某种淡入淡出/阿尔法混合,这样字幕就会在底部淡入和/或在顶部淡出,但我也被困在如何做到这一点上。*
**实际上,为此我想我可以覆盖一些半透明渐变,只要背景是纯色即可。*
I'm looking to create a (possibly 3D) scrolling credits screen for my app, that is similar to what you might see at the end of a movie, but should be able to include graphics, animations, etc.
What is the best way to go about doing this? I'm thinking I could create a very tall UserControl that contains the entire content to scroll and then just animate it inside a ScrollViewer, or even just a Canvas and animate the position, but there are obvious performance issues with doing something like that and I'm afraid it would be too slow.
It would be cool if the credits could scroll on a 3D surface, kind of like Star Wars, or with a fisheye effect, but I know squat about 3D in WPF.
I do definitely want some kind of fading/alpha-blending so the credits appear to fade in at the bottom and/or fade out at the top, but I'm also stuck on how to do that.*
**Actually, for that I guess I could overlay some semitransparent gradient, so long as the background was a solid color.*
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,由于似乎没有人有任何评论,所以我继续按照我所描述的方式进行操作,并且必须说结果非常好。 我使用垂直 LinearGradientBrush 进行淡入淡出,并简单地在 Canvas 内对 UserControl 进行动画处理以进行滚动(将 Canvas.Top 从
这是动画(注意我必须在代码中将 DoubleAnimation.To 设置为scroller.ActualHeight):
这是
scroller
元素:(还有一些其他内容正在发生,因此为什么滚动从0:0:30。)
这是推子:
Well since nobody seems to have any comments, I went ahead and did things how I described and must say the results are quite good. I used a vertical LinearGradientBrush to do the fading, and simply animated a UserControl inside a Canvas for the scrolling (animating Canvas.Top from <ActualHeight of Canvas> to (negative)<ActualHeight of UserControl>). Looks pretty good. :)
Here's the animation (note I had to set DoubleAnimation.To in code to scroller.ActualHeight):
And here's the
scroller
element:(There is some other stuff going on, hence why the scrolling starts at 0:0:30.)
Here's the fader:
您可以使用 VisualBrush 在 3d 表面上“绘制”您的制作人员名单用户控件。
You can use a VisualBrush to "paint" your credits user control on a 3d surface.