Qt Forum

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

    Rendering images on Android using QML image type performance issues

    Mobile and Embedded
    2
    2
    1039
    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.
    • S
      sedonk last edited by

      Rendering images with QtQuick 2.0 is very slow! About 40 seconds for a full hd png image.

      There is no difference in performance whether the image comes from a remote server or from the assets folder.

      gsm: Sony Xperia Z

      @Image {
      anchors.fill : parent
      source : ShopSettings.builtin_shoplist_backgroundimage
      fillMode : Image.PreserveAspectCrop

      Column {
          anchors.fill : parent
      
          Loader {
              id :header
              width : parent.width
              source : Shop.getQml( "ShopListHeader.qml")
          }
      
          ListView {
              id : shopList
              height : parent.height - header.height
              width : parent.width
              model : Shop.visitedShops();
              delegate : Loader {
                  id : shopListEntry
                  width : parent.width
                  source : Shop.getQml( "ShopListElement.qml" );
              }
          }
      }
      

      }@

      1 Reply Last reply Reply Quote 0
      • C
        cosmam last edited by

        Have you tried using the "sourceSize":http://qt-project.org/doc/qt-5/qml-qtquick-image.html#sourceSize-prop property of the QML image element?

        If I'm remembering what I've done correctly, and I'm reading the documentation right, it should improve things by not loading the image at full resolution (which could be huge!), but at a scaled down resolution.

        Compiling it in to the resources file, rather than loading it remotely or from disk, should also help quite a bit. If I recall correctly, disk I/O on Android in cases like this is really slow, but a compiled-in resource is fast (this usually comes up with reading/loading the qml files themselves, but could be applicable here).

        1 Reply Last reply Reply Quote 0
        • First post
          Last post