Results 1 to 3 of 3

Thread: Problem rendering QImage from Phonon Widget

  1. #1
    Join Date
    Sep 2007
    Location
    Rome, GA
    Posts
    199
    Thanks
    14
    Thanked 41 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Problem rendering QImage from Phonon Widget

    Qt Code:
    1. //create an image the size of the Phonon::VideoWidget
    2. QImage video_image(phonon_widget->size(), QImage::Format_RGB32);
    3.  
    4. //render the widget image onto the QImage
    5. phonon_widget->render(&video_image);
    6.  
    7. video_image.save("c:/test.jpg");
    To copy to clipboard, switch view to plain text mode 

    Does anyone know why this wouldn't work? I save this image and all I get is a gray box. I've tried the same procedure with other widgets and it works perfectly. I found some forum posts on the subject, but they weren't any help really. There is video on the screen playing. I've tried pausing it before I render. I've tried using grabWidget(), to no avail.

    I feel it's probably something simple I'm not considering...please help me if you can...Daniel

  2. #2
    JuanC Guest

    Default Re: Problem rendering QImage from Phonon Widget

    I am also interesting on how to save a frame into QImage.

  3. #3
    Join Date
    Sep 2007
    Location
    Rome, GA
    Posts
    199
    Thanks
    14
    Thanked 41 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Problem rendering QImage from Phonon Widget

    We've pretty much narrowed our problem down to the way phonon interacts with directshow on windows. We think the widget never actually contains the video image, but that directshow tells the graphics card where to draw on the screen directly. Could be wrong, but that's how it seems.

    Because of this I'm working on an audio-video class of my own that uses the ffmpeg API and libavcodec . When I am done, I'll post the class here so that others can use it. It will be able to do anything phonon can at present + more + be cross-platform.

Similar Threads

  1. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35

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.