Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Dynamic Image scaling/rotation

    QML and Qt Quick
    2
    8
    2052
    Loading More Posts
    • 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
      bradsco last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • B
          bradsco last edited by

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • B
              bradsco last edited by

              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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • B
                  bradsco last edited by

                  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 Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    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 Reply Quote 0
                    • First post
                      Last post