Hi all,
I'm triyng to save a image buffer only grey into an image.
When I save to a file a get an error saying QVector<T> out of range.
Is there something I'm missing?

Thanks in advance for any answer

Qt Code:
  1. QImage tmp(width, height, QImage::Format_Indexed8);
  2. memcpy(tmp.bits(), pFrame->data[0], width * height);
  3. QString filename = QString("C:\\testscene\\frame%1.jpg").arg(durationText);
  4. tmp.scaledToHeight(120, Qt::SmoothTransformation).save(filename);
To copy to clipboard, switch view to plain text mode