Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Dynamic Image scaling/rotation
Forum Update on Monday, May 27th 2025

Dynamic Image scaling/rotation

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 2 Posters 2.7k 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.
  • B Offline
    B Offline
    bradsco
    wrote on 26 Jan 2015, 18:53 last edited by
    #1

    This may be a simple question with a simple answer, so here's hoping... I have an image and I need to compensate for its orientation. To me this means I have to transform the content, not simply set a rotation for it to be drawn, because the actual image bits need to eventually be passed on to OpenGL for generation as a texture.

    So the question... within QML (be it inline script or a function... but not C++), does anyone have a suggestion how I might execute an transform based on an arbitrary rotation? I don't know what the rotation is at the time of the UI's creation, it has to happen afterwards. (In an onClicked: block for example)

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 26 Jan 2015, 21:55 last edited by
      #2

      Hi,

      Do you mean something like "Rotation":http://doc.qt.io/qt-5/qml-qtquick-rotation.html#details ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bradsco
        wrote on 26 Jan 2015, 22:41 last edited by
        #3

        Sure, that is the concept. However, it is my understanding that rotation is simply a value that tells the QML engine how to draw that image, it doesn't actually transform the content of the image. (By transform I mean "manipulate the bits in the image", not just turn the rectangle on its side.)

        For instance, if I have a portrait image and set rotation to 90, it would be drawn on its side. If I copy that image to another, the second image would still be in portrait, not a new version of the content on its side.

        Is my understanding of the rotation value correct or am I missing something?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 5 Feb 2015, 00:27 last edited by
          #4

          Indeed, you understood it correctly. I'm not sure that the manipulation you would like to do are available in QML

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bradsco
            wrote on 5 Feb 2015, 16:17 last edited by
            #5

            Just to close the topic out, at this point in time it seems the only solution is to pass the content from QML to C++ and perform the rotation there.

            The reason for asking in the first place is that the QML camera does not always operate as expected. In this instance on an iPhone 6 it was taking pictures that were offset by 90 degrees from the orientation of the viewfinder. Android phones and tablets performed correctly as did iPads.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 5 Feb 2015, 16:52 last edited by
              #6

              Then it's a bug, does your iPad and iPhone share the same iOS version ?

              In any case, you should take a look at the "bug report system":http://bugreports.qt.io to see if it's something known

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • B Offline
                B Offline
                bradsco
                wrote on 9 Feb 2015, 18:46 last edited by
                #7

                I think there are a few bugs tied to the camera in iOS.

                https://bugreports.qt.io/browse/QTBUG-42035

                Even after trying the 5.4.1 snapshot, my issues still persist. Besides re-submitting a bug report, do you know of a way to contact anyone involved in the testing/debugging/release process?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 9 Feb 2015, 21:52 last edited by
                  #8

                  You can ask on the "interest mailing list":http://lists.qt-project.org/mailman/listinfo/interest (don't forget to subscribe first) or the #qt IRC channel. If you have one of the commercial license you can also contact the Qt Company through the Support Center

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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