简体   繁体   English

需要透明的叠加窗口在窗口绘制视频的顶部绘制线条吗? :: MFC,C ++,Windows ::

[英]Need transparent overlay window to draw lines on top of window drawing video? ::MFC,C++,windows::

How do you create a transparent window that can be placed over another window that is actively having streaming video drawn to it. 如何创建一个透明窗口,可以将其放置在另一个正在吸引流式视频的窗口上。 I want to create a window on top of the video window that I can draw on without video constantly drawing back over it. 我想在视频窗口上方创建一个窗口,这样我就可以在没有视频不断在其上回拖的情况下进行绘制。

I can create a window from a transparent dialog resource and set its z-order using SetWindowPos(...) but it doesn't seem to have any effect. 我可以从透明对话框资源中创建一个窗口,并使用SetWindowPos(...)设置其z顺序,但是它似乎没有任何作用。 Having the dialog set as a WS_CHILD style or WS_POPUP also appears to have no effect. 将对话框设置为WS_CHILD样式或WS_POPUP似乎也不起作用。

I'm using a media (video) framework another development group in my company developed and am providing a window handle to that code. 我正在使用媒体(视频)框架,这是公司中另一个开发小组开发的,并且正在提供该代码的窗口句柄。 That handle is being used by their rendering plugin in the pipeline that uses Direct3d for rendering the video on that window surface. 他们的渲染插件正在使用Direct3d在该窗口表面上渲染视频的管道中使用该句柄。

Video is rendered to a hardware overlay in the video adapter. 视频将渲染到视频适配器中的硬件覆盖上。 You'll need to create your own to overlay that overlay. 您需要创建自己的叠加层。 I think DirectX provides that capability, you can also get it by using the WS_EX_LAYERED window style and the SetLayeredWindowAttributes(). 我认为DirectX提供了该功能,您也可以使用WS_EX_LAYERED窗口样式和SetLayeredWindowAttributes()来获得它。 Which you'll need to set the transparency key. 您需要设置透明度键。 Not so sure that's a slam-dunk btw, I've seen this behave oddly. 不太确定那是灌篮高手,我见过这种情况很奇怪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM