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. Rotation of a QImage by 90 degrees
QtWS25 Last Chance

Rotation of a QImage by 90 degrees

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 4.3k Views
  • 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.
  • U Offline
    U Offline
    Uday More
    wrote on last edited by
    #1

    I have a QImage(32*128) as shown below.

    intensity.png

    I want to rotate it by 90 degrees which may look like this

    intensity.png

    Is there a simple function to rotate the QImage.

    Also will the resolution change, when we rotate the image.

    KroMignonK 1 Reply Last reply
    0
    • U Uday More

      I have a QImage(32*128) as shown below.

      intensity.png

      I want to rotate it by 90 degrees which may look like this

      intensity.png

      Is there a simple function to rotate the QImage.

      Also will the resolution change, when we rotate the image.

      KroMignonK Offline
      KroMignonK Offline
      KroMignon
      wrote on last edited by
      #2

      @Uday-More said in Rotation of a QImage by 90 degrees:

      Is there a simple function to rotate the QImage.

      I would say QImage::transformed() should do the job:

      QImage img("src.jpg");
      QImage rotatedImg = img.transformed(QMatrix().rotate(90.0));
      rotatedImg.save("rotated.jpg");
      

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      1 Reply Last reply
      3
      • U Offline
        U Offline
        Uday More
        wrote on last edited by
        #3

        @KroMignon . Thanks
        It works with transform function

        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