

See The Qt Resource System overview for details on how to embed images and other resource files in the application’s executable. When loading an image, the file name can either refer to an actual file on disk or to one of the application’s embedded resources. QImage also provides the static fromData() function, constructing a QImage from the given data. QImage provides several ways of loading an image file: The file can be loaded when constructing the QImage object, or by using the load() or loadFromData() functions later on. QImage objects can also be streamed and compared. QImage objects can be passed around by value since the QImage class uses implicit data sharing. There are also several functions that enables transformation of the image. QImage provides a collection of functions that can be used to obtain a variety of information about the image. These include monochrome, 8-bit, 32-bit and alpha-blended images which are available in all versions of Qt 4.x. The QImage class supports several image formats described by the Format enum. When using QPainter on a QImage, the painting can be performed in another thread than the current GUI thread. Finally, the QPicture class is a paint device that records and replays QPainter commands.īecause QImage is a QPaintDevice subclass, QPainter can be used to draw directly onto images.

QBitmap is only a convenience class that inherits QPixmap, ensuring a depth of 1. QImage is designed and optimized for I/O, and for direct pixel access and manipulation, while QPixmap is designed and optimized for showing images on screen. Qt provides four classes for handling image data: QImage, QPixmap, QBitmap and QPicture. Def convertToFormat (f, colorTable)ĭef convertToFormat (f)ĭef convertToFormat_helper (format, flags)ĭef convertToFormat_inplace (format, flags)ĭef createAlphaMask ()ĭef createHeuristicMask ()ĭef createMaskFromColor (color)ĭef mirrored (])ĭef mirrored_helper (horizontal, vertical)ĭef mirrored_inplace (horizontal, vertical)ĭef save (device])ĭef save (fileName])ĭef scaled (s])ĭef scaled (w, h])ĭef scaledToHeight (h)ĭef scaledToWidth (w)ĭef transformed (matrix)
