我希望将QImage绑定到MMF文件上,以便在不直接占用内存的情况下操作图像。不幸的是,我的代码会在内存中创建一个副本。
QFile file("Boston City Flow.jpg");
if(!file.open(QIODevice::ReadOnly))
QMessageBox::information(this, "Error", "Error");
qint64 size = file.size();
unsigned char *mmf = file.map(0, size);
QImage image;
image.loadFromData(mmf, size, NULL);
我的程序需要处理非常大的图像。