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. Avoid Mouse pointer flicker while taking screenshot of the entire screen
QtWS25 Last Chance

Avoid Mouse pointer flicker while taking screenshot of the entire screen

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 2.6k 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.
  • J Offline
    J Offline
    jash156
    wrote on last edited by
    #1

    hello ,

    I am using the below mentioned method to take screenshot of my screen and as the process is continuous the mouse pointer keeps on flickering, is there any alternative method using which i can take screenshot without causing the mouse pointer to flicker,

    Code snipppet used in our case
    QImage qimg(QGuiApplication::primaryScreen()->grabWindow(QApplication::desktop()->winId()).toImage());

    Please suggest any alternative method if possible

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

      Hi and welcome
      Have you checked if the sample
      http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html
      also flickers with mouse?

      J 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi and welcome
        Have you checked if the sample
        http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html
        also flickers with mouse?

        J Offline
        J Offline
        jash156
        wrote on last edited by
        #3

        @mrjj hello, thank you for the link, but i have implemented the given example before, the flickering of mouse pointer is still there,

        This issue occurs on windows OS as i am taking continous screenshots of the desktop

        1 Reply Last reply
        0
        • Ni.SumiN Offline
          Ni.SumiN Offline
          Ni.Sumi
          wrote on last edited by Ni.Sumi
          #4

          Hi @jash156 ,
          Try this,
          QPixmap screenshot;
          screenshot = QPixmap::grabWindow(QApplication::desktop()->winId()) ;
          screenshot.save(Qstring(_____________.png);

          J 2 Replies Last reply
          0
          • Ni.SumiN Ni.Sumi

            Hi @jash156 ,
            Try this,
            QPixmap screenshot;
            screenshot = QPixmap::grabWindow(QApplication::desktop()->winId()) ;
            screenshot.save(Qstring(_____________.png);

            J Offline
            J Offline
            jash156
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • Ni.SumiN Ni.Sumi

              Hi @jash156 ,
              Try this,
              QPixmap screenshot;
              screenshot = QPixmap::grabWindow(QApplication::desktop()->winId()) ;
              screenshot.save(Qstring(_____________.png);

              J Offline
              J Offline
              jash156
              wrote on last edited by
              #6

              @Ni.Sumi I tired the method provided by u as well, the issue occurs due to taking screenshot in milliseconds continuously in a loop, can u suggest something for that

              1 Reply Last reply
              0
              • Ni.SumiN Offline
                Ni.SumiN Offline
                Ni.Sumi
                wrote on last edited by Ni.Sumi
                #7

                Hi @jash156 ,

                usually, QPixmap::grabWindow does not take cursor or some flickering(as per documentation).

                Are you using QgraphicsView or a normal widget like Qdialog /QWidget?
                If possible, could you please share code here. so that its easy to find out.

                J 1 Reply Last reply
                0
                • Ni.SumiN Ni.Sumi

                  Hi @jash156 ,

                  usually, QPixmap::grabWindow does not take cursor or some flickering(as per documentation).

                  Are you using QgraphicsView or a normal widget like Qdialog /QWidget?
                  If possible, could you please share code here. so that its easy to find out.

                  J Offline
                  J Offline
                  jash156
                  wrote on last edited by jash156
                  #8

                  hello @Ni.Sumi ,

                  I am just using the method mentioned by you using a QWidget and sending then sending the screenshot in jpg format over network

                  and for the code, it is just the first example you gave which i run in a while loop to get continuous screenshot.

                  1 Reply Last reply
                  0
                  • mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Hi if you only take picture of you own window, then maybe call
                    setCursor( QCursor( Qt::BlankCursor ) );
                    to hide it while sending ?

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      bnogal
                      wrote on last edited by bnogal
                      #10

                      From what i know.
                      Just paint another mouse pointer

                      I think windows OS hides the mouse while taking a capture.
                      It is something internal.

                      Only option i see is to paint another mouse pointer that Windows will not hide while making the capture call.

                      Just make a fast check... keep pressing "imp pant" key and look... it is the same effect.

                      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