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. [Solved] How to change resolution of an image with Qt?
Forum Updated to NodeBB v4.3 + New Features

[Solved] How to change resolution of an image with Qt?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 6.2k Views 1 Watching
  • 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.
  • L Offline
    L Offline
    Leon
    wrote on last edited by
    #1

    Is there a way to change the resolution of an image with Qt?
    I mean as a file.. You know like for e.g change the resolution of the image to 48x48...

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      QImage::scaled?

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vsorokin
        wrote on last edited by
        #3

        @QImage QImage::scaledToWidth ( int width, Qt::TransformationMode mode = Qt::FastTransformation ) const@

        bq.
        Returns a scaled copy of the image. The returned image is scaled to the given width using the specified transformation mode.
        This function automatically calculates the height of the image so that its aspect ratio is preserved.
        If the given width is 0 or negative, a null image is returned

        @QImage QImage::scaledToHeight ( int height, Qt::TransformationMode mode = Qt::FastTransformation ) const@

        bq.
        Returns a scaled copy of the image. The returned image is scaled to the given height using the specified transformation mode.
        This function automatically calculates the width of the image so that the ratio of the image is preserved.
        If the given height is 0 or negative, a null image is returned.

        --
        Vasiliy

        1 Reply Last reply
        0
        • L Offline
          L Offline
          Leon
          wrote on last edited by
          #4

          I would prefer SmoothTransformation for better quality.
          Thanks again! :)

          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