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

grabToImage: wrong image resolution with high dpi scaling

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.9.0, 5.10.0 Alpha
    • None
    • Samsung Galaxy S7
    • iOS/tvOS/watchOS

    Description

      When high dpi scaling is activated (QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling) then grabToImage produces a low resolution image with the size=screen_size/scaling_factor. When high dpi scaling is deactivated then the grabToImage creates an image with the correct resolution.

      import QtQuick 2.7
      import QtQuick.Controls 2.0
      import QtQuick.Layouts 1.3
      
      import QtLocation 5.9
      import QtPositioning 5.8
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          Map {
              id: map
              anchors.fill: parent
      
              plugin: Plugin {
                  name: "osm"
              }
          }
      
          footer: Button {
              text: "Popup"
      
              onClicked: map.grabToImage(function(result) {
                  result.saveToFile("/storage/emulated/0/DCIM/something.png");
              });
          }
      }
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              DanielSt Peter Staab
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes