Nominate our 2022 Qt Champions!

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

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

  • 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

Log in to reply