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. ScreenShot with Qt using Rocky Linux 9
QtWS25 Last Chance

ScreenShot with Qt using Rocky Linux 9

Scheduled Pinned Locked Moved Unsolved General and Desktop
screenshotrocky linux
2 Posts 2 Posters 322 Views
  • 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.
  • R Offline
    R Offline
    RezaA
    wrote on last edited by
    #1

    Hi all,
    I have an application on Linux.
    I make a screenshot as follows :

    QScreen *screen = QGuiApplication::primaryScreen();
    QPixmap pixmap = screen->grabWindow(0);
    bool result = pixmap.save("sc,"PNG");
    

    This works correctly when I use CentOS-7 but when using Rocky Linux 9, I have a black screenshot.
    Is there anyway to resolve this problem ?

    Thanks in advance !

    SGaistS 1 Reply Last reply
    0
    • R RezaA

      Hi all,
      I have an application on Linux.
      I make a screenshot as follows :

      QScreen *screen = QGuiApplication::primaryScreen();
      QPixmap pixmap = screen->grabWindow(0);
      bool result = pixmap.save("sc,"PNG");
      

      This works correctly when I use CentOS-7 but when using Rocky Linux 9, I have a black screenshot.
      Is there anyway to resolve this problem ?

      Thanks in advance !

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Which desktop environment are you using ?
      With which window manager ?

      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