如何在视频控件上创建透明标签
我在这里几乎没有想法...对于其他一切,将背景颜色设置为 Color.Transparent 或设置 TransparencyKey 效果很好...
我有一个 mp4 视频,我需要将其作为我的“背景”播放形式。为此,我当前使用 WMP 控件。我的问题:我无法在其上添加任何控件,因为它们总是呈现背景。视频上看起来**...
有什么建议吗?
I'm pretty much out of ideas here... for everything else, setting the background color to Color.Transparent or setting the TransparencyKey works fine...
I have an mp4 Video which I need to play as a "background" of my form. To do this, I'm currently using the WMP control. My problem: I can't add any controls on top of it, since they always render a background. Which looks ** on the video...
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在类似情况下成功使用过的一个技巧:
告诉你这是一个黑客。但如果你把所有的事件和计算都连接起来,它应该可以正常工作。
PS 我还记得必须做一个轮询计时器,其功能确保每 250 毫秒左右,两种形式的 Z 顺序就是您想要的。 (切换应用程序和窗口会意外地更改 z 顺序,并且不会发生事件,因此需要轮询解决方案。)
PS II 很容易对该解决方案的可行性进行原型设计。只需创建一个具有上述规格的单独应用程序并将其移动到您的视频上即可。 (您需要保留表单边框才能轻松移动/调整窗口大小。)
A hack I've used successfully in a similar situation:
Told you it was a hack. But if you get all the events and calculations wired up it should work fine.
P.S. I also recall having to do a poll timer with a function that made sure every 250 millis or so that the Z-order of the two forms was what you wanted. (Switching apps and windows changed the z-order unexpectedly and w/o events, thus the polling solution.)
P.S. II It is very easy to prototype the feasibility of this solution. Just create a separate app with the above-mentioned specs and move it over your video. (You will need to retain the Form border to be able to move/resize the window easily.)
尝试使用 GDI+ 渲染标签:
您可以在此处查看示例:(使用 GDI+ 绘制具有透明度的图像部分):
http://www.broculos.net /en/article/how-use-transparent-images-and-labels-windows-forms
Try rendering your labels using GDI+:
You can see sample here: (the Using GDI+ for drawing images with transparency part):
http://www.broculos.net/en/article/how-use-transparent-images-and-labels-windows-forms