I hope to load a big image, for example 10MP with the QImage. But it is too slow, is there a better way to speed up the loading process?
Thanks
I hope to load a big image, for example 10MP with the QImage. But it is too slow, is there a better way to speed up the loading process?
Thanks
If the image takes 10MB compressed (I take it that this is the case) then it has to take time to load and to uncompress itself. There is no way to avoid it. What you can do is compose the image from smaller images. Qt doesn't support progressive loading as it could also be a kind of a solution for you. What you can do is to load the image in another thread so that your application remains responsive while the image is being opened.
learning_qt (26th November 2008)
How can we compose the big image from small images? Or can we cut a big image to small images?
Once loaded you can cut the image to smaller parts.QImage QImage::copy ( const QRect & rectangle = QRect() ) const
Returns a sub-area of the image as a new image.
The returned image is copied from the position (rectangle.x(), rectangle.y()) in this image, and will always have the size of the given rectangle.
In areas beyond this image, pixels are set to 0. For 32-bit RGB images, this means black; for 32-bit ARGB images, this means transparent black; for 8-bit images, this means the color with index 0 in the color table which can be anything; for 1-bit images, this means Qt::color0.
If the given rectangle is a null rectangle the entire image is copied.
See also QImage().
Last edited by jacek; 26th November 2008 at 18:15. Reason: changed [code] to [quote]
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
Bookmarks