Qt Forum

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

    Qt Academy Launch in California!

    Solved Invert colors of B/W image

    General and Desktop
    4
    5
    4781
    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.
    • R
      ranshalit last edited by

      Hello,

      I am using stylesheet for the image (black/white image):
      img: url(:/resource/img.png);
      Is it possible to invert color of image attached to QLable in stylesheet (or any other methods ) ?

      Thanks,
      Ran

      1 Reply Last reply Reply Quote 0
      • johngod
        johngod last edited by

        Hi
        I never tryed anything like that, but a quick look at the docs shows http://doc.qt.io/qt-5/qimage.html#invertPixels maybe this can help ?

        1 Reply Last reply Reply Quote 2
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          To add to @johngod why use a style sheet to put an image in a QLabel ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          R 1 Reply Last reply Reply Quote 0
          • R
            ranshalit @SGaist last edited by

            @SGaist
            Hi,

            Do you mean that pixmap is better for image ?

            Thanks,
            Ran

            mrjj 1 Reply Last reply Reply Quote 0
            • mrjj
              mrjj Lifetime Qt Champion @ranshalit last edited by

              @ranshalit
              The QLabel support setting the image directly.
              Even its called setPixmap it does take any image supported by Qt.
              You can even browse the resource and browse to it , directly in Designer.

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