View Full Version : Transparency over video

19th May 2010, 17:28
Hi! I'm using a library which renders a video over a QLabel. The video is rendered using DirectShow. I noticed that placing something over the video with a transparency acts like no video was rendered. So, transparency is made like if only the QLabel was under it. Any idea why? Any way to make the widget aware that the video is under it so that transparency is real?

20th May 2010, 11:28
My guess is, that the QLabel hWnd is given to DirectShow, which renders the image directly on it.
This means, that the QLabel it self, is not aware of the operation, and its paintEvent() is not part of it -thus, the transparent widget above it, does not know anything about the image rendered on the QLabel, and can't use that information to draw its self on the image, but just on the QLabel.

20th May 2010, 11:30
Thus there is no way to create that effect?

20th May 2010, 11:38
You would have to render the video into Qt's backingstore. When the transparent widget is rendered over the video the backingstore contents (containing the label and the transparent widget but not the video) overpaints the video you have drawn earlier. You can try rendering the video using direct show to a buffer and then composing that buffer with the rest of content using Qt's methods. You can also play with the PaintOnScreen flag.