Hi. I want bind QImage to the MMF file to manipulate the image without the cost of memory directly on the disc. Unfortunately, my code creates a copy in memory.
QFile file("Boston City Flow.jpg");
qint64 size = file.size();
unsigned char *mmf = file.map(0, size);
image.loadFromData(mmf, size, NULL);
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);
To copy to clipboard, switch view to plain text mode
My program needs to handle very large images.
Bookmarks