Hi
I am reading a raw binary data from a file into QBytearray. I want to use the QBytearray to construct a QImage. My code is shown below.
fileIn.
open(QFile::ReadOnly);
BPlaneIN->setPixmap(qp);
QFile fileIn (fileName);
fileIn.open(QFile::ReadOnly);
QByteArray data = fileIn.readAll();
QImage img(2048,1024,QImage::Format_Indexed8);
img = QImage::fromData(data,QImage::Format_Indexed8);
QPixmap qp=QPixmap::fromImage(img);
BPlaneIN->setPixmap(qp);
To copy to clipboard, switch view to plain text mode
error: conversion from `QByteArray' to `const uchar*' is ambiguous
Could some tell me why I get this error message. I have used scanline to get this working but am confused as to why this method of loading the buffer doesnt
Regards
Bookmarks