I misunderstood the description of QImage::Format_RGBA8888, I figured it converted the color order to RGB regardless of if the arch is little or big endian.
I've not tested on a big endian machine but using ARGB32 produces the right order of colors.
This commit is contained in:
parent
07ba3830a3
commit
c0657c13e5
@ -136,7 +136,7 @@ void hgx11grab::_grabFrame()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage qimg = *new QImage(reinterpret_cast<const uchar *>(_xImage_p->data), _destWidth_m, _destHeight_m, _xImage_p->bytes_per_line, QImage::Format_RGBA8888);
|
QImage qimg = *new QImage(reinterpret_cast<const uchar *>(_xImage_p->data), _destWidth_m, _destHeight_m, _xImage_p->bytes_per_line, QImage::Format_ARGB32);
|
||||||
qimg = qimg.convertToFormat(QImage::Format_RGB888);
|
qimg = qimg.convertToFormat(QImage::Format_RGB888);
|
||||||
imgdata_m.clear();
|
imgdata_m.clear();
|
||||||
imgdata_m = QByteArray::fromRawData(reinterpret_cast<const char *>(qimg.bits()), qimg.byteCount());
|
imgdata_m = QByteArray::fromRawData(reinterpret_cast<const char *>(qimg.bits()), qimg.byteCount());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user