Hi
Thanks, Yes I've read it. The data loaded from the file is raw 8bit binary data. I want to load the data into QByteArray and then load the image buffer with the contents of QByteArray.
Is this QImage member funxction
bool QImage::loadFromData ( const QByteArray & data, const char * format = 0 )
equivalent to
void loadImageData
(uchar
*data,
int rows,
int cols,
QImage *rawImage
) {
uchar* row;
for (int i = 0; i < rows; i++)
{
//access each row of data values
row= rawImage->scanLine(i);
for (int j = 0; j < cols; j++) //width
row[j] =data[i * cols + j] ;
}
}
void loadImageData(uchar *data, int rows,int cols,QImage *rawImage)
{
uchar* row;
for (int i = 0; i < rows; i++)
{
//access each row of data values
row= rawImage->scanLine(i);
for (int j = 0; j < cols; j++) //width
row[j] =data[i * cols + j] ;
}
}
To copy to clipboard, switch view to plain text mode
Thanks for your advice
Bookmarks