Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to make a bitmap image transparent? Is it possible to assign alpha channel to bitmap images!?
QtWS25 Last Chance

How to make a bitmap image transparent? Is it possible to assign alpha channel to bitmap images!?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.2k 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.
  • A Offline
    A Offline
    aravindan
    wrote on 29 Mar 2018, 05:06 last edited by
    #1

    When we are working on Win32, we remove the background of bitmap image which contains black by masking it to make an image transparent one. But we moved the concept now in Qt side, now we are facing the issue of how to make an image transparent . We tried of setting the image background to black too but it is not working. Even tried setting alpha channel to image ,no changes is happening.

    If any one has idea about how to make this work in Qt side?, please share your concerns.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 29 Mar 2018, 06:10 last edited by
      #2

      Not completely understood the requirement. Let me try answering the same. You can use QImage to load the images. You can manipulate pixels using the QImage. Just see if this helps.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 29 Mar 2018, 08:04 last edited by
        #3

        Hi
        Qt supports full transparency so you can just change the actual images to contain
        the transparent area. ImageMagick can do that in batch if needed.
        Anyway, there is also
        http://doc.qt.io/qt-5/qimage.html#createAlphaMask
        http://doc.qt.io/qt-5/qimage.html#createHeuristicMask

        1 Reply Last reply
        3

        2/3

        29 Mar 2018, 06:10

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved