Post by Emre Cetin
I have a project related to image processing on QT and GStream. I have created a program with QWidget, and I got a screenshot of this program with QPixmap. However, I need to convert these frames into a YUV format and send them to GStream because I am going to merge these frames another video frames with GStream.
Is there any way I can get QWidget frames in YUV format? Without conversion. I am working on QT 5.5. Any advice ?
If you really get that from a screen, that will need to be converted _somewhere_.
On the other hand, QImage is a QPaintDevice and supports different image formats. So it is possible to render a QWidget (+ its child hierarchy) directly into a QImage by using the QWidget::render(....) method, similar to printing a widget: https://doc.qt.io/qt-5/qtprintsupport-index.html#printing-widgets . I’d expect that to be as direct as it gets.
Principal Software Engineer
The Qt Company GmbH
Rudower Chaussee 13
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B