Results 1 to 4 of 4

Thread: Transparency over video

  1. #1
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Transparency over video

    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?
    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Transparency over video

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Transparency over video

    Thus there is no way to create that effect?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Transparency over video

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    Luc4 (28th May 2010)

Similar Threads

  1. Playing video using Phonon video widget
    By Leolander in forum Newbie
    Replies: 0
    Last Post: 26th February 2010, 07:15
  2. Replies: 3
    Last Post: 5th July 2009, 18:22
  3. Video freezes during mpeg video playback using Phonon
    By davejames in forum Qt Programming
    Replies: 2
    Last Post: 12th January 2009, 09:45
  4. transparency
    By roms18 in forum Qt Programming
    Replies: 2
    Last Post: 16th February 2006, 20:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.