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. What is faster, scale, tile or clip image?

What is faster, scale, tile or clip image?

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 3.6k Views 1 Watching
  • 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.
  • Z Offline
    Z Offline
    Zmozie
    wrote on last edited by
    #1

    Hi I have some issues with performance.
    I have > 60 bars(item/rectangle) in a graph that only contains an image that fills the whole bar.
    When I animate the change in height it gets a bit slow.

    Therefore I'm wondering what's the most efficient way of rendering the image, an gradient thats 1px high.
    Tile or scale the image or paint the image bigger than the bar from the beginning and let the bar clip the image?

    Beside this I also have a problem that the image gets 1px higher than the bar at some heights but without images it looks as it should, could this be a bug?

    !http://img811.imageshack.us/img811/1573/problemfr.png!

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      I would use a QLinearGradient for this, rather than an image.

      Edit: Oh, qt quick, no clue about that.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        I understand drawing gradients is slow, and the recommendation is to use images if you can. But couldn't you just try to see what performs better in your use case? My guess would be: tiling, but I am far from sure.

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          Zmozie
          wrote on last edited by
          #4

          I can try to see what feels fastest, but it would have been good to know what is fastest.

          And the problem that the image don't scale to the edges or too long is not only for images, also borders will behave the same. But an empty rectangle will behave exactly as I would expect, anyone got any idea what could be the problem?

          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