Currently I create an QImage first and pass that to a pixmap. This is done with this code:
Code:
{ int r, g, b; r = g = b = 0; for ( int y = 0; y < m_size_y; y++ ) { QRgb *line = (QRgb *)image.scanLine(y) ; for ( int x = 0; x < m_size_x; x++ ) { int pos = ArrPos(x,y); r = d->red[pos]; g = d->green[pos]; b = d->blue[pos]; *line++ = qRgb(r, g, b); } } return image; } { }
Now my question is, if it would be possible to create a pixmap image without creating an QImage first.
My main concern about the QImage step is the time required for the conversions.