Thanks for the answers.
I tried this
for (int i=0; i<=255; i++)
{
colorTable.append(qRgb(i, i, i));
}
tmp.setColorTable(colorTable);
memcpy(tmp.bits(), pFrame->data[0], width * height);
QString filename
= QString("C:\\testscene\\frame%1.png").
arg(durationText
);
tmp.scaledToHeight(120, Qt::SmoothTransformation).save(filename);
for (int i=0; i<=255; i++)
{
colorTable.append(qRgb(i, i, i));
}
QImage tmp(width, height, QImage::Format_Indexed8);
tmp.setColorTable(colorTable);
memcpy(tmp.bits(), pFrame->data[0], width * height);
QString filename = QString("C:\\testscene\\frame%1.png").arg(durationText);
tmp.scaledToHeight(120, Qt::SmoothTransformation).save(filename);
To copy to clipboard, switch view to plain text mode
Now there's no error but the resulting png is all black.
Any idea?
thanks again
Bookmarks