Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Unable to take screenshot of Qt3D window with transparent background on Mac
Forum Updated to NodeBB v4.3 + New Features

Unable to take screenshot of Qt3D window with transparent background on Mac

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt3dqt3dwindowqforwardrenderdefaultframegraqt3drender
2 Posts 2 Posters 763 Views 1 Watching
  • 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.
  • P Offline
    P Offline
    poortipant
    wrote on last edited by
    #1

    Hi,

    I have an application that renders 3d (dae) files.
    I also have a feature on my application - to take screenshots of the current scene.

    I am using Qt 5.12 on a Mac 10.14.6

    I implemented functionality so that the screenshot could be taken with a transparent
    background. This is working fine on Windows, but for some unknown reason it does not make the background transparent on Mac.

    This is the code,

    
    Qt3DRender::QRenderCaptureReply m_renderCaptureReply;
    ...
    ...
    QColor color = QColor(255, 255, 255, 0);
    if (color.isValid())
    	view->defaultFrameGraph()->setClearColor(color);
    
    m_renderCaptureReply = m_renderCapture->requestCapture();
    connect(m_renderCaptureReply, SIGNAL(completed()), this, SLOT(saveImageToFile()));
    
    
    
    void My3DQtViewer::saveImageToFile()
    {
        QImage image(m_renderCaptureReply->image().size(), QImage::Format_ARGB32);
        image.save(m_screenshotfilename, "PNG");
    }
    
    

    The image is being saved as png but with a white background.

    Any ideas what's missing?

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I can't answer to that directly.

      Can you provide a minimal compilable example that shows that behaviour ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved