使用 IVMRWindowlessControl 在 Winforms 控件中显示视频并允许全屏切换
我最近在自定义 Winforms 控件中从使用 IVideoWindow 接口切换到使用 IVMRWindowlessControl 来显示视频。
这样做的原因是为了允许控件内的视频具有缩放功能。
然而,在切换时,我发现 IVideoWindow 的全屏模式不可用,我目前正在尝试使用 SetVideoWindow() 方法复制此模式。
我发现我将控件中的视频大小调整为与屏幕的分辨率相同,但是我无法让控件将其自身定位到屏幕的顶部/左侧并成为最顶部的窗口。
既然 IVideoWindow::put_FullScreenMode 已经为您完成了这一切,那么关于如何实现这一点有什么想法吗?
I've recently switched from using the IVideoWindow interface to IVMRWindowlessControl in my custom Winforms control to display video.
The reason for this was to allow zoom capabilities on the video within the control.
However in switching over, I've found that the FullScreen mode from IVideoWindow is not available and I am currently trying to replicate this using the SetVideoWindow() method.
I'm finding that I size the video in my control to be at the same resolution as the screen however I can't get the control to position itself to the top/left of the screen and become the top most window.
Any ideas on how to achieve this since the IVideoWindow::put_FullScreenMode just did it all for you?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过以新的形式托管视频控件来解决全屏问题,我将其大小调整为当前屏幕的大小,然后处理形式中的“Escape”按键,以切换回正常大小的视频。以下是代码摘录:-
成员
切换全屏代码
Resolved the FullScreen problem by hosting the video control in a fresh form which I resized to the size of the current screen, then handled the 'Escape' key press in the form, to toggle back to the normal size video. Here's an extract of the code:-
Members
Toggle FullScreen code