Hi! I'm trying to read data pointed by unsigned char* in RG565 in QImage. I found something on the forums, and I wrote this... but the result is not the image...
for (int i = 0; i < 256; i++) rawImage->setColor(i, qRgb(i, i, i));
for (int i = 0; i < _height; i++) {
unsigned char* image = rawImage->scanLine(i);
for (int j = 0; j < _width*2; j++) image[j] = data[i*_width*2 + j];
}
rawImage->save("path");
QImage* rawImage = new QImage(QSize(_width, _height), QImage::Format_RGB16);
for (int i = 0; i < 256; i++) rawImage->setColor(i, qRgb(i, i, i));
for (int i = 0; i < _height; i++) {
unsigned char* image = rawImage->scanLine(i);
for (int j = 0; j < _width*2; j++) image[j] = data[i*_width*2 + j];
}
rawImage->save("path");
To copy to clipboard, switch view to plain text mode
Any idea what could be wrong?
Thanks!
Bookmarks