我的工作环境:Qt 5.8 MSVC2015 64bit, QT GraphicsView, Windows 7 64 bit
我正在从缓冲区加载图像(一个恶魔进程将发送一个图像缓冲区),但它无法使用缓冲区创建图像。
QFile file("D:\\2.png");
if (!file.open(QFile::ReadOnly))
qDebug() << "Error failed to Open file";
QByteArray array = file.readAll();
array = array.toBase64();
QImage tempimage((uchar *)array.data(), 250, 250, QImage::Format_RGBX8888);
if (!tempimage.isNull()) {
///I always get this error
qDebug() << "Error!!! failed to create a image!";
}
知道我在这里缺少什么吗?