Results 1 to 2 of 2

Thread: Transparent image over video

  1. #1
    Join Date
    Apr 2009
    Thanked 1 Time in 1 Post
    Qt products
    Unix/X11 Windows

    Question Transparent image over video

    In my project I have video to display and at time I will need to overlay video with some image that has transparent background. I have tried setting transparent image as QPixmap into QLabel, but here is what I get, the transparency is visible when the label/image is over the main widget, but when the image is over the video, the transparency is over black background and no over the video. This I tried with QT 4.8.x

    Now when I got QT5, I decided to try it out. To convert my project to qt5, might take some time, so for testing purpose, i use "Player" example
    Then I added the following code:
    Qt Code:
    1. iconLabel = new QLabel(this);
    2. QPixmap p("controlNext.png");
    3. p = p.scaled(192,192);
    4. iconLabel->setPixmap(p);
    5. iconLabel->setGeometry(100,200,192,192);
    6. cb = new ControlButton(QIcon("controlNext.png"),
    7. QIcon("controlNextHovered.png"),
    8. QIcon("controlNextPressed.png"),
    9. this);
    10. cb->setIconSize(QSize(192,192));
    11. cb->setGeometry(300,200,192,192);
    To copy to clipboard, switch view to plain text mode 
    I have tried displaying transparent background image via QLabel and a QPushButton. ControlButton, is my custom button that I use in my project. Attached is what I get. The image is transparent over the application, but with black background over the video.

    Is there a way to set it up so that there will be no black background when widgets/images is over the video?
    I have searched this site, but seems without any luck. I have tried "Videos get pimped Published November 28, 2008 | By tbastian" at , but then no video is shown at all.

    Any help would be appreciated

  2. #2
    Join Date
    Aug 2012
    Qt products
    Qt4 Qt/Embedded

    Default Re: Transparent image over video

    I realize this is a shot in the dark given that this is a 2.5 year old thread...but.

    Did you ever resolve this issue? I'm having the exact same problems. Transparency worked great for me in qt4.6, but it's totally broken with qt5.3

Similar Threads

  1. using QPixmap to transparent image
    By sophister in forum Qt Programming
    Replies: 2
    Last Post: 8th July 2010, 13:06
  2. Replies: 8
    Last Post: 16th March 2010, 13:27
  3. Phonon Video + Transparent Label Problems
    By jftaylor21 in forum Qt Programming
    Replies: 2
    Last Post: 1st November 2009, 18:53
  4. Converting to transparent Image
    By navi1084 in forum Qt Programming
    Replies: 5
    Last Post: 28th August 2009, 13:25
  5. Create Transparent PNG Image
    By hvitual in forum Qt Programming
    Replies: 1
    Last Post: 2nd August 2009, 14:35

Tags for this Thread


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.