How to change the colour on the image?



  • 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 ?


  • Moderators

    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.



  • Thanks mate..


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.