0

I need read the raw data(bgra5551) into QImage and display it and write the QImage to raw data back(bgra5551), Qt only supports Format_RGB555, is there any way make Format_RGB555 transparent(alpha channel 255)?

I tired this:

QImage getImage(uchar* data, int width, int height){
    return QImage(data, width, height, QImage::Format_RGB555).copy();
}
uchar* getData(QImage img){
    return img.bits();
}

QImage imgRGB555 = getImage(bgra5551, width, height);
// problem1: imgRGB555 is not transparent.
uchar* org = getData(imgRGB555);
// problem2: bgra5551 != org 
JustWe
  • 4,250
  • 3
  • 39
  • 90

0 Answers0