[Qt-interest] How can I read a large image fastly?
Kermit Mei
kermit.mei at gmail.com
Thu Feb 4 15:26:55 CET 2010
Thomas Dähling wrote:
> To understand you correctly:
>
> You have a picture that is 4k by 4k in it's resolution, and you only
> want to display the first 320x240 pixels of it without reading in the
> 4000x4000 pixel image first?
>
No, I need the entirety of the picture, but it should be scaled into
320x240.
So I hope that I can select the pixel that I want to show, because my
memory is small, I thinks that can make it faster.
> In that scenario I guess the problem here is that QImageReader cannot
> know when the desired clipRect area is read from the device it uses -
> simply because that depends a lot upon the format the image is stored
> in and thus has to read in the whole image first. You might have to
> write your own reader class if you want to improve this.
>
> /Thomas
>
Later, I found that QImageReader can get the clipRect, but it also must
scan the whole picture or load it into memory before. I think this
processing make it work slowly.
<snip>
Thanks.
B.R
Kermit
More information about the Qt-interest-old
mailing list