| Home · All Classes · Annotated · Functions |
The QThumbnail class is used to generate thumbnails of large images. More...
#include <QThumbnail>
The QThumbnail class is used to generate thumbnails of large images.
Create a QThumbnail with an image file name then use pixmap() to generate thumbnails of different sizes.
For example:
QPainter painter( this );
QThumbnail thumbnail( "image.jpg" );
painter.drawPixmap( offset, thumbnail.pixmap( size() ) );
In addition actualSize() can be used to determine the actual size of a thumbnail for a requested size and aspect mode.
For some image formats QThumbnail will efficiently generate thumbnails by scaling the image as it is being loaded. For other formats the whole image will be loaded and then scaled.
Constructs the object for the given image fileName.
Destroys the thumbnail.
Returns the actual size of the thumbnail for the requested size and mode. An invalid size is returned if the image is not able to be read. The whole image may be loaded if the image handler does not support the QImageIOHandler::Size option. Currently only the JPEG image handler supports the QImageIOHandler::Size option.
See also pixmap().
Returns a pixmap with the requested size and mode. A null pixmap is returned if the image cannot be loaded.
The pixmap will be generated by scaling the image as it is being loaded where possible. This is reliant on the support for the QImageIOHandler::ScaledSize option in the image handler. If the option is not supported the whole image will be loaded and then scaled. Currently only the JPEG image handler supports the QImageIOHandler::ScaledSize option.
See also actualSize().
| Copyright © 2006 Trolltech | Trademarks | Qtopia 4.1.7 |