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

Provides an argument to grab either logical or actual pixel size for grabToImage

    XMLWordPrintable

Details

    Description

      About grabToImage:
      https://doc.qt.io/qt-6/qml-qtquick-item.html#grabToImage-method
      It is said that "Use targetSize to specify the size of the target image. By default, the result will have the same size as the item", but it is not necessarily true. On Retina display, like on MacBook, the result size is well 2x the targetSize/item size.

      I know it is because of high DPI and device pixel ratio calculations. But maybe we'd better document it. One step further, let user explicitly choose to grab either logical or actual pixel size.

      A simple little sample is attached. grabToImage is told to grab a 400x300 image and the result is 800x600

      Attachments

        1. QTBUG-128355.zip
          3 kB
          Luqiao Chen
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            luqiaochen Luqiao Chen
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes