Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-46803

QCocoaScreen::grabWindow doesn't work with retina and if an area is specified

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.4.2, 5.9.8, 5.11
    • QPA
    • None
    • OS X 10.10.3 on a MacBook Pro with Retina display.
    • macOS

    Description

      The following example program is run on a Mac with retina display:

      #include <QApplication>
      #include <QWindow>
      #include <QScreen>
      #include <QPixmap>
      
      int main(int argc, char** argv)
      {
          QApplication a(argc, argv);
          QWindow win;
          QPixmap pm = win.screen()->grabWindow(0, 0, 0, 20, 30);
          pm.save("/tmp/a.png");
      }
      

      The saved image is of size 40x60 pixels which seems to be correct. But the displayed area is not the retina content, but rather the content of the logical coordinates 40x60 instead of the logcial coordinates 20x30.

      Attachments

        Activity

          People

            sorvig Morten Sørvig
            rms@froglogic.com Rainer
            Votes:
            8 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: