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. [SOLVED] Setting 8bit alpha channel/mask to QPixmap?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Setting 8bit alpha channel/mask to QPixmap?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 0 Posters 2.4k 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.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

    I've been looking through the DOC and was unable to find a way to set more than 1 bit mask to a QPixmap. Also all alpha channel extraction methods output a 1bit QBitmap. This simply destroys all precision of the 8bit alpha channel images I use...

    Is there a way to extract 8 bit alpha channel from 24bit PNG and set it as 8 bit mask to a QPixmap?

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      Figured out a fairly low level way to do it - if anyone should care to do the same - it is achievable by "injecting" alpha data into the appropriate locations of a QByteArray and using QPixmap::loadFromData to turn it back into a pixmap

      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