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. How to rotate an image 90 clockwise?
QtWS25 Last Chance

How to rotate an image 90 clockwise?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 2.8k 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.
  • M Offline
    M Offline
    MasterBlade
    wrote on last edited by
    #1

    I want to rotate a qpixmap 90 and place it at the same qlabel. What should I do?

    J.HilkJ 1 Reply Last reply
    0
    • M MasterBlade

      I want to rotate a qpixmap 90 and place it at the same qlabel. What should I do?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      hi @MasterBlade
      to rotate a QPixmap, you have to call transform on it
      that will return a rotated Pixmap, the original is unchanged.


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      5
      • KillerSmathK Offline
        KillerSmathK Offline
        KillerSmath
        wrote on last edited by
        #3

        @MasterBlade

        Use Transformed function

        QPixmap p1("URL");
        QPixmap p2 = p1.transformed(QTransform().rotate(90));
        
        label->setPixmap(p2);
        

        @Computer Science Student - Brazil
        Web Developer and Researcher
        “Sometimes it’s the people no one imagines anything of who do the things that no one can imagine.” - Alan Turing

        1 Reply Last reply
        6
        • M Offline
          M Offline
          MasterBlade
          wrote on last edited by
          #4

          Thanks for the help!!!

          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