Please nominate your Qt Champions for 2021!

Set resolution of screenshot image of 3D rendering

  • Hi All,

    I have developed a Qt application which can render 3D files.
    One of its features is an option to take screenshots of the current state of the 3D rendering.

    Here is the code snippet,

    // Set capture entity
    // Save the rendering by calling this method
    void My3DQtViewer::saveImage(QString filename)
        m_screenshotfilename = filename;
        m_renderCaptureReply = m_renderCapture->requestCapture();
        connect(m_renderCaptureReply, SIGNAL(completed()), this, SLOT(saveImageToFile()));
    // Save image to file
    void My3DQtViewer::saveImageToFile()

    The code works fine and I am able to take screenshots perfectly.
    Is there any way I can control the resolution/quality of the image being saved?

    If I can present the user with options to change the resolution of the output image, how will I incorporate this in the code?


Log in to reply