Important: Please read the Qt Code of Conduct -

QRenderCapture help

  • Hello

    I create a 3D image in my GUI that look something like this:


    I create it like this

    Qt3DExtras::Qt3DWindow *view = new Qt3DExtras::Qt3DWindow();
    QWidget *container = QWidget::createWindowContainer(view);
    Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity();

    Then I add camera, light and objects to the rootEntity and add the root to the view. As you can see from the image, it works ok.

    Now I would like to save the image to a png file (preferable with the black background as transparent if possible).

    I found that QRenderCapture might be the way to go, and found the following example:

    However, when I try to implement it, the reply never completes.

    I also tried to save the container widget as an image, but then i only get the black background.

    Do anyone know how to save the 3D rendered image to a png file?

  • @AndersDK Hi,
    Do you need a 'screenshot' ?

  • A screenshot could work, but it should only be of the 3D image part of my GUI. Also I guess if I use a screen shot, I can't make the black background transparent?

    Furthermore I would like to get the image, without showing it in the GUI. I mean render the 3D part, but not showing it to the user. Don't know if that is even possible

Log in to reply