在Qt中处理非常大的图像 [英] Handling very large images in Qt

查看:181
本文介绍了在Qt中处理非常大的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法让Qt处理超过10,000X10,000的图片。我处理的是大约2GB的巨大卫星图像。我考虑使用内存映射,但映像仍占用内存中的空间。

I can't get Qt to work on images beyond 10,000X10,000. I'm dealing with huge satellite images that are around 2GB each. I considered using memory mapping but the image still occupies space in memory.

QFile file("c://qt//a.ras");
file.open(QIODevice::ReadOnly);
qint64 size = file.size();
uchar *img=file.map(0,size);
QImage I(img,w,h,QImage::Format_ARGB32);

任何人都能告诉我一种更有效的方式来处理Qt中的大图片?

Can anyone tell me a more efficient way to deal with large images in Qt?

推荐答案

Qgraphicsview 和一组图像图块,视图处理所有的滚动和世界坐标为你。

然后你只需要将图像预先切成瓷砖或提前一段图像数据

Qgraphicsview and a set of image tiles, the view handles all the scrolling and world coords for you.
Then you just have to either pre-chop the images into tiles in advance or pull a section of image data on the fly

这篇关于在Qt中处理非常大的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆