Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QRenderCapture help

    General and Desktop
    2
    3
    428
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      AndersDK last edited by

      Hello

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

      0_1530607880800_cb461333-3a4e-415f-9a8c-b3d6881e3165-image.png

      I create it like this

      Qt3DExtras::Qt3DWindow *view = new Qt3DExtras::Qt3DWindow();
      view->defaultFrameGraph()->setClearColor(QColor(QRgb(0x4d4d4f)));
      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:

      http://code.qt.io/cgit/qt/qt3d.git/tree/tests/manual/rendercapture-cpp

      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?

      ODБOï 1 Reply Last reply Reply Quote 0
      • ODБOï
        ODБOï @AndersDK last edited by

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

        1 Reply Last reply Reply Quote 0
        • A
          AndersDK last edited by AndersDK

          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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post