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

grabToImage: wrong image resolution with high dpi scaling

XMLWordPrintable

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

      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");
              });
          }
      }
      

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes