如何在全屏幕中显示/显示MediaElement前面的文本块? [英] How Do I Display/Show a Textblock In Front of a MediaElement in Fullscreen?

查看:101
本文介绍了如何在全屏幕中显示/显示MediaElement前面的文本块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用VB.net和XAML在Visual Studio 2013中创建一个简单的电影/音乐播放器Windows应用商店应用。



我正在使用MediaElement,当它设置为IsFullWindow = True时,我的所有控件都隐藏在它后面。



有没有办法可以在MediaElement前面显示一个TextBlock,这样我就可以添加字幕了?



任何帮助都会非常感激。



谢谢

Hi,

I'm creating a simple movie/music player Windows Store app in Visual Studio 2013 using VB.net and XAML.

I am using a MediaElement and when it is set as IsFullWindow = True, all my controls are hidden behind it.

Is there a way that I can show a TextBlock in front of the MediaElement so that I can add in subtitles?

Any help would be much appreciated.

Thanks

推荐答案

由于IsFullWindow属性必须将所有其他控件都放到后台,所以没办法去做这个。但是,有一种方法可以做到这一点,因为许多其他媒体播放器,如VLC媒体播放器都使用这种技术,在全窗口模式下也可以在屏幕上显示字幕;这使得这种行为成为可能。



但是,Windows API确实教你为应用程序编写个人(自定义)完整窗口样式,以设计你的整个模板应用程序,看起来像一个FullWindow并显示其他控件。这个可以由您实现,它可以让您控制整个设计和UI控件。内置的Microsoft控件不会让您在构建应用程序时脱离轨道,并且您必须坚持U​​I准则,要偏离轨道,您只能使用自己的控件。



阅读这个文档 [ ^ ]了解有关创建自定义媒体传输控件的更多信息。
Since the IsFullWindow property has to put all other controls to the background, there is no way for you to do this. But yes, there is a way to do this, because many other Media players such as VLC media player makes a use of such technique, to show the subtitles on screen in the Full Window mode too; which makes this behaviour possible.

However, Windows API does teach you to program a personal (custom) full window style for your applications, to design the entire template of your application, to look like a FullWindow and show other controls on it too. This one can be implmented by you, which will let you control the entire design and the UI controls. The built-in Microsoft's controls don't let you get off the track while building applications, and you have to stick to the UI guidelines, to go off-track you can only use your own controls.

Read this documentation[^] to learn more on creating custom media transport controls.


这篇关于如何在全屏幕中显示/显示MediaElement前面的文本块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆