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. How to change the colour on the image?
QtWS25 Last Chance

How to change the colour on the image?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 2.1k 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.
  • C Offline
    C Offline
    Craig27
    wrote on last edited by
    #1

    We are having a transparent image and we want the colour of that image according to the theme selected.

    Is it possible in Qt or QML ?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      It is. But there are so many ways to do this depending on what your needs actually are...

      One could be simply this: place a qml Rectangle over your image, make it partially transparent and adjust the colour as you wish (take a look at Qt.tint() method, might come in handy). Or use several different source images and swap them when the theme is changed. Or write your own painting code for a new qml component. Or use GL shaders.

      (Z(:^

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Craig27
        wrote on last edited by
        #3

        Thanks mate..

        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