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 Color an Image
Forum Updated to NodeBB v4.3 + New Features

How to Color an Image

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 3 Posters 1.7k 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.
  • E Offline
    E Offline
    econtech
    wrote on last edited by
    #1

    Hi,

    How to color an image using quick 1.1.In quick 2.0,it is done using ColorOverlay,But i want it to be done in Quick 1.1.

    Thanks in Advance

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

      I doubt it is possible by using only QML in Quick 1.1.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        onek24
        wrote on last edited by
        #3

        Hey,

        do you want to do it only using QML or may be a mix of c++ and QML an option?

        1 Reply Last reply
        0
        • E Offline
          E Offline
          econtech
          wrote on last edited by
          #4

          Can anyone please suggest a approach that could meet above requirement.

          Thanks

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

            One option may be to use the fact that Quick 1.1. is based on QGraphicsView and friends. That means that you can also use other things that work in QGraphicsView, including... QGraphicsEffect and its subclasses.

            I think I'd try to create my own QML element that encapsulates a QGraphicsColorizeEffect, and apply it to the parent item. Doesn't sound all that difficult to do.

            You start by creating a QDeclarativeItem subclass, that you expose to the QML engine by calling qmlRegisterType for it, and then using the appropriate import in your QML file.

            1 Reply Last reply
            0
            • E Offline
              E Offline
              econtech
              wrote on last edited by
              #6

              Hi ,

              we can mix c++ and QML. If we can do it in QML, it is more helpful.

              Thanks

              1 Reply Last reply
              0
              • O Offline
                O Offline
                onek24
                wrote on last edited by
                #7

                Sorry, i don't know of a method on how to do it with QtQuick 1.1 only, but you might check out "ShaderEffectItem":http://qt-project.org/doc/qt-4.8/qml-shadereffectitem.html . Maybe this could help you to solve your problem. Otherwise you can modify your image(colorize it and so on...) in C++, pass it back to QML and display it.

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  econtech
                  wrote on last edited by
                  #8

                  Thank you all.I Solved it by registering QGraphicsColorizeEffect and applying effect for QML Image.

                  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