Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QImage, ARGB and RGBA, alpha channel is never first in raw bits
theonlylawislove last edited by
I have an image that I am setting it's pixels to
QColor(200, 201, 203, 155)(R:200,G:201,B:203,A:155).
Format_RGBA8888, the raw bits are ordered in RGBA, which is expected.
However, when using
Format_ARGB32, the raw bits are ordered in BGRA, which is seemingly incorrect. I expected ARGB.
What format should I used to get the alpha channel represented as the first byte of each pixel (32bit)?
VRonin last edited by
The result you are having is just dictated by the endianness of your system. You can see it in https://code.woboq.org/qt5/qtbase/src/gui/image/qimage.cpp.html#2374