Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPixmap Class Reference

Returns a copy of the pixmap that is transformed using the given transformation transform and transformation mode. More...

#include <qpixmap.h>

+ Inheritance diagram for QPixmap:
+ Collaboration diagram for QPixmap:

Public Types

typedef QExplicitlySharedDataPointer< QPlatformPixmapDataPtr
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric {
  PdmWidth = 1 , PdmHeight , PdmWidthMM , PdmHeightMM ,
  PdmNumColors , PdmDepth , PdmDpiX , PdmDpiY ,
  PdmPhysicalDpiX , PdmPhysicalDpiY , PdmDevicePixelRatio , PdmDevicePixelRatioScaled
}
 

Public Member Functions

 QPixmap ()
 Constructs a null pixmap.
 
 QPixmap (QPlatformPixmap *data)
 
 QPixmap (int w, int h)
 Constructs a pixmap with the given width and height.
 
 QPixmap (const QSize &)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Constructs a pixmap of the given size.
 
 QPixmap (const QString &fileName, const char *format=nullptr, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Constructs a pixmap from the file with the given fileName.
 
 QPixmap (const char *const xpm[])
 Constructs a pixmap from the given xpm data, which must be a valid XPM image.
 
 QPixmap (const QPixmap &)
 Constructs a pixmap that is a copy of the given pixmap.
 
 QPixmap (QPixmap &&other) noexcept
 Move-constructs a QPixmap instance from other.
 
 ~QPixmap ()
 Destroys the pixmap.
 
QPixmapoperator= (const QPixmap &)
 Assigns the given pixmap to this pixmap and returns a reference to this pixmap.
 
void swap (QPixmap &other) noexcept
 
bool operator== (const QPixmap &) const =delete
 
bool operator!= (const QPixmap &) const =delete
 
 operator QVariant () const
 Returns the pixmap as a QVariant.
 
bool isNull () const
 Returns true if this is a null pixmap; otherwise returns false.
 
int devType () const override
 
int width () const
 Returns the width of the pixmap.
 
int height () const
 Returns the height of the pixmap.
 
QSize size () const
 Returns the size of the pixmap.
 
QRect rect () const
 Returns the pixmap's enclosing rectangle.
 
int depth () const
 Returns the depth of the pixmap.
 
void fill (const QColor &fillColor=Qt::white)
 Fills the pixmap with the given color.
 
QBitmap mask () const
 Returns true if this pixmap has an alpha channel, or has a mask, otherwise returns false.
 
void setMask (const QBitmap &)
 Sets a mask bitmap.
 
qreal devicePixelRatio () const
 Returns the device pixel ratio for the pixmap.
 
void setDevicePixelRatio (qreal scaleFactor)
 Sets the device pixel ratio for the pixmap.
 
QSizeF deviceIndependentSize () const
 Returns the size of the pixmap in device independent pixels.
 
bool hasAlpha () const
 
bool hasAlphaChannel () const
 
QBitmap createHeuristicMask (bool clipTight=true) const
 Creates and returns a heuristic mask for this pixmap.
 
QBitmap createMaskFromColor (const QColor &maskColor, Qt::MaskMode mode=Qt::MaskInColor) const
 Creates and returns a mask for this pixmap based on the given maskColor.
 
QPixmap scaled (int w, int h, Qt::AspectRatioMode aspectMode=Qt::IgnoreAspectRatio, Qt::TransformationMode mode=Qt::FastTransformation) const
 
QPixmap scaled (const QSize &s, Qt::AspectRatioMode aspectMode=Qt::IgnoreAspectRatio, Qt::TransformationMode mode=Qt::FastTransformation) const
 
QPixmap scaledToWidth (int w, Qt::TransformationMode mode=Qt::FastTransformation) const
 Returns a scaled copy of the image.
 
QPixmap scaledToHeight (int h, Qt::TransformationMode mode=Qt::FastTransformation) const
 Returns a scaled copy of the image.
 
QPixmap transformed (const QTransform &, Qt::TransformationMode mode=Qt::FastTransformation) const
 
QImage toImage () const
 Converts the pixmap to a QImage.
 
bool load (const QString &fileName, const char *format=nullptr, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Loads a pixmap from the file with the given fileName.
 
bool loadFromData (const uchar *buf, uint len, const char *format=nullptr, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Loads a pixmap from the len first bytes of the given binary data.
 
bool loadFromData (const QByteArray &data, const char *format=nullptr, Qt::ImageConversionFlags flags=Qt::AutoColor)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Loads a pixmap from the binary data using the specified format and conversion flags.
 
bool save (const QString &fileName, const char *format=nullptr, int quality=-1) const
 Saves the pixmap to the file with the given fileName using the specified image file format and quality factor.
 
bool save (QIODevice *device, const char *format=nullptr, int quality=-1) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This function writes a QPixmap to the given device using the specified image file format and quality factor.
 
bool convertFromImage (const QImage &img, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Replaces this pixmap's data with the given image using the specified flags to control the conversion.
 
QPixmap copy (int x, int y, int width, int height) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a deep copy of the subset of the pixmap that is specified by the rectangle QRect( x, y, width, height).
 
QPixmap copy (const QRect &rect=QRect()) const
 Returns a deep copy of the subset of the pixmap that is specified by the given rectangle.
 
void scroll (int dx, int dy, int x, int y, int width, int height, QRegion *exposed=nullptr)
 
void scroll (int dx, int dy, const QRect &rect, QRegion *exposed=nullptr)
 
qint64 cacheKey () const
 Returns a number that identifies this QPixmap.
 
bool isDetached () const
 
void detach ()
 Detaches the pixmap from shared pixmap data.
 
bool isQBitmap () const
 Returns true if this is a QBitmap; otherwise returns false.
 
QPaintEnginepaintEngine () const override
 
bool operator! () const
 Returns true if this is a null pixmap; otherwise returns false.
 
QPlatformPixmaphandle () const
 
DataPtrdata_ptr ()
 
- Public Member Functions inherited from QPaintDevice
virtual ~QPaintDevice ()
 
bool paintingActive () const
 
int width () const
 
int height () const
 
int widthMM () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
qreal devicePixelRatio () const
 
qreal devicePixelRatioF () const
 
int colorCount () const
 
int depth () const
 

Static Public Member Functions

static int defaultDepth ()
 
static QTransform trueMatrix (const QTransform &m, int w, int h)
 Returns the actual matrix used for transforming a pixmap with the given width, height and matrix.
 
static QPixmap fromImage (const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Converts the given image to a pixmap using the specified flags to control the conversion.
 
static QPixmap fromImageReader (QImageReader *imageReader, Qt::ImageConversionFlags flags=Qt::AutoColor)
 Create a QPixmap from an image read directly from an imageReader.
 
static QPixmap fromImage (QImage &&image, Qt::ImageConversionFlags flags=Qt::AutoColor)
 
- Static Public Member Functions inherited from QPaintDevice
static qreal devicePixelRatioFScale ()
 

Protected Member Functions

int metric (PaintDeviceMetric) const override
 
- Protected Member Functions inherited from QPaintDevice
 QPaintDevice () noexcept
 
virtual void initPainter (QPainter *painter) const
 
virtual QPaintDeviceredirected (QPoint *offset) const
 
virtual QPaintersharedPainter () const
 

Static Protected Member Functions

static QPixmap fromImageInPlace (QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
 

Friends

class QPlatformPixmap
 
class QBitmap
 
class QPaintDevice
 
class QPainter
 
class QOpenGLWidget
 
class QWidgetPrivate
 
class QRasterBuffer
 
Q_GUI_EXPORT QDataStreamoperator>> (QDataStream &, QPixmap &)
 Reads an image from the given stream into the given pixmap.
 

Related Symbols

(Note that these are not member symbols.)

QDataStreamoperator<< (QDataStream &stream, const QPixmap &pixmap)
 Writes the given pixmap to the given stream as a PNG image.
 
QDataStreamoperator>> (QDataStream &stream, QPixmap &pixmap)
 Reads an image from the given stream into the given pixmap.
 

Additional Inherited Members

- Protected Attributes inherited from QPaintDevice
ushort painters
 

Detailed Description

Returns a copy of the pixmap that is transformed using the given transformation transform and transformation mode.

The original pixmap is not changed.

The transformation transform is internally adjusted to compensate for unwanted translation; i.e. the pixmap produced is the smallest pixmap that contains all the transformed points of the original pixmap. Use the trueMatrix() function to retrieve the actual matrix used for transforming the pixmap.

This function is slow because it involves transformation to a QImage, non-trivial computations and a transformation back to a QPixmap.

See also
trueMatrix(), {QPixmap::Pixmap Transformations}{Pixmap Transformations}

\inmodule QtGui

The QPixmap class is an off-screen image representation that can be used as a paint device.

Qt provides four classes for handling image data: QImage, QPixmap, QBitmap and QPicture. 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. QBitmap is only a convenience class that inherits QPixmap, ensuring a depth of 1. The isQBitmap() function returns true if a QPixmap object is really a bitmap, otherwise returns false. Finally, the QPicture class is a paint device that records and replays QPainter commands.

A QPixmap can easily be displayed on the screen using QLabel or one of QAbstractButton's subclasses (such as QPushButton and QToolButton). QLabel has a pixmap property, whereas QAbstractButton has an icon property.

QPixmap objects can be passed around by value since the QPixmap class uses implicit data sharing. For more information, see the \l {Implicit Data Sharing} documentation. QPixmap objects can also be streamed.

Note that the pixel data in a pixmap is internal and is managed by the underlying window system. Because QPixmap is a QPaintDevice subclass, QPainter can be used to draw directly onto pixmaps. Pixels can only be accessed through QPainter functions or by converting the QPixmap to a QImage. However, the fill() function is available for initializing the entire pixmap with a given color.

There are functions to convert between QImage and QPixmap. Typically, the QImage class is used to load an image file, optionally manipulating the image data, before the QImage object is converted into a QPixmap to be shown on screen. Alternatively, if no manipulation is desired, the image file can be loaded directly into a QPixmap.

QPixmap provides a collection of functions that can be used to obtain a variety of information about the pixmap. In addition, there are several functions that enables transformation of the pixmap.

Definition at line 26 of file qpixmap.h.

Member Typedef Documentation

◆ DataPtr

Definition at line 147 of file qpixmap.h.

Constructor & Destructor Documentation

◆ QPixmap() [1/8]

QPixmap::QPixmap ( )

Constructs a null pixmap.

See also
isNull()

Definition at line 78 of file qpixmap.cpp.

References QPlatformPixmap::PixmapType, qt_pixmap_thread_test(), and void.

Referenced by copy(), fromImage(), fromImageInPlace(), and fromImageReader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QPixmap() [2/8]

QPixmap::QPixmap ( QPlatformPixmap * d)
explicit

Definition at line 133 of file qpixmap.cpp.

◆ QPixmap() [3/8]

QPixmap::QPixmap ( int width,
int height )

Constructs a pixmap with the given width and height.

If either width or height is zero, a null pixmap is constructed.

Warning
This will create a QPixmap with uninitialized data. Call fill() to fill the pixmap with an appropriate color before drawing onto it with QPainter.
See also
isNull()

Definition at line 99 of file qpixmap.cpp.

◆ QPixmap() [4/8]

QPixmap::QPixmap ( const QSize & size)
explicit

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Constructs a pixmap of the given size.

Warning
This will create a QPixmap with uninitialized data. Call fill() to fill the pixmap with an appropriate color before drawing onto it with QPainter.

Definition at line 114 of file qpixmap.cpp.

◆ QPixmap() [5/8]

QPixmap::QPixmap ( const QString & fileName,
const char * format = nullptr,
Qt::ImageConversionFlags flags = Qt::AutoColor )

Constructs a pixmap from the file with the given fileName.

If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap.

The loader attempts to read the pixmap using the specified format. If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.

The file name can either refer to an actual file on disk or to one of the application's embedded resources. See the \l{resources.html}{Resource System} overview for details on how to embed images and other resource files in the application's executable.

If the image needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.

The fileName, format and flags parameters are passed on to load(). This means that the data in fileName is not compiled into the binary. If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

See also
{QPixmap::Reading and Writing Image Files}{Reading and Writing Image Files}

Definition at line 167 of file qpixmap.cpp.

References fileName, load(), QPlatformPixmap::PixmapType, and qt_pixmap_thread_test().

+ Here is the call graph for this function:

◆ QPixmap() [6/8]

QPixmap::QPixmap ( const char *const xpm[])
explicit

Constructs a pixmap from the given xpm data, which must be a valid XPM image.

Errors are silently ignored.

Note that it's possible to squeeze the XPM variable a little bit by using an unusual declaration:

static const char * const start_xpm[] = {
"16 15 8 1",
"a c #cec6bd",
// etc.
};

The extra const makes the entire definition read-only, which is slightly more efficient (for example, when the code is in a shared library) and ROMable when the application is to be stored in ROM.

Definition at line 221 of file qpixmap.cpp.

References QPlatformPixmap::BitmapType, QBitmap::fromImage(), fromImage(), and QPlatformPixmap::PixmapType.

+ Here is the call graph for this function:

◆ QPixmap() [7/8]

QPixmap::QPixmap ( const QPixmap & pixmap)

Constructs a pixmap that is a copy of the given pixmap.

See also
copy()

Definition at line 183 of file qpixmap.cpp.

References pixmap, QPlatformPixmap::PixmapType, and qt_pixmap_thread_test().

+ Here is the call graph for this function:

◆ QPixmap() [8/8]

QPixmap::QPixmap ( QPixmap && other)
inlinenoexcept

Move-constructs a QPixmap instance from other.

See also
swap() operator=(QPixmap&&)

Definition at line 38 of file qpixmap.h.

◆ ~QPixmap()

QPixmap::~QPixmap ( )

Destroys the pixmap.

Definition at line 243 of file qpixmap.cpp.

References Q_ASSERT.

Member Function Documentation

◆ cacheKey()

qint64 QPixmap::cacheKey ( ) const

Returns a number that identifies this QPixmap.

Distinct QPixmap objects can only have the same cache key if they refer to the same contents.

The cacheKey() will change when the pixmap is altered.

Definition at line 888 of file qpixmap.cpp.

References isNull(), and Q_ASSERT.

Referenced by QWindowsOleDropSource::createCursors(), QPdfEngine::drawPixmap(), QWindowsOleDropSource::GiveFeedback(), QBrush::operator==(), PixmapEntry::pixmap(), QPixmapIconEngine::scaledPixmap(), QLabel::setPixmap(), QWindowsDragCursorWindow::setPixmap(), and QBasicDrag::updateCursor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertFromImage()

bool QPixmap::convertFromImage ( const QImage & image,
Qt::ImageConversionFlags flags = Qt::AutoColor )

Replaces this pixmap's data with the given image using the specified flags to control the conversion.

The flags argument is a bitwise-OR of the \l{Qt::ImageConversionFlags}. Passing 0 for flags sets all the default options. Returns true if the result is that this pixmap is not null.

Note: this function was part of Qt 3 support in Qt 4.6 and earlier. It has been promoted to official API status in 4.7 to support updating the pixmap's image without creating a new QPixmap as fromImage() would.

See also
fromImage()
Since
4.7

Definition at line 980 of file qpixmap.cpp.

References detach(), fromImage(), and isNull().

Referenced by QPixmapIconEngineEntry::QPixmapIconEngineEntry().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy() [1/2]

QPixmap QPixmap::copy ( const QRect & rectangle = QRect()) const

Returns a deep copy of the subset of the pixmap that is specified by the given rectangle.

For more information on deep copies, see the \l {Implicit Data Sharing} documentation.

If the given rectangle is empty, the whole image is copied.

See also
operator=(), QPixmap(), {QPixmap::Pixmap Transformations}{Pixmap Transformations}

Definition at line 276 of file qpixmap.cpp.

References QPixmap(), QPlatformPixmap::createCompatiblePlatformPixmap(), d, height(), QRect::isEmpty(), isNull(), rect(), and width().

+ Here is the call graph for this function:

◆ copy() [2/2]

QPixmap QPixmap::copy ( int x,
int y,
int width,
int height ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a deep copy of the subset of the pixmap that is specified by the rectangle QRect( x, y, width, height).

Definition at line 153 of file qpixmap.h.

References copy().

Referenced by detach(), QWindowsDirect2DPaintEngine::drawPixmap(), QWin32PrintEngine::drawPixmap(), QPainter::drawPixmap(), and QBitmap::fromPixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createHeuristicMask()

QBitmap QPixmap::createHeuristicMask ( bool clipTight = true) const

Creates and returns a heuristic mask for this pixmap.

The function works by selecting a color from one of the corners and then chipping away pixels of that color, starting at all the edges. If clipTight is true (the default) the mask is just large enough to cover the pixels; otherwise, the mask is larger than the data pixels.

The mask may not be perfect but it should be reasonable, so you can do things such as the following:

QPixmap myPixmap;
myPixmap.setMask(myPixmap.createHeuristicMask());

This function is slow because it involves converting to/from a QImage, and non-trivial computations.

See also
QImage::createHeuristicMask(), createMaskFromColor()

Definition at line 657 of file qpixmap.cpp.

References createHeuristicMask(), QBitmap::fromImage(), and toImage().

Referenced by createHeuristicMask(), and QGraphicsPixmapItemPrivate::updateShape().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createMaskFromColor()

QBitmap QPixmap::createMaskFromColor ( const QColor & maskColor,
Qt::MaskMode mode = Qt::MaskInColor ) const

Creates and returns a mask for this pixmap based on the given maskColor.

If the mode is Qt::MaskInColor, all pixels matching the maskColor will be transparent. If mode is Qt::MaskOutColor, all pixels matching the maskColor will be opaque.

This function is slow because it involves converting to/from a QImage.

See also
createHeuristicMask(), QImage::createMaskFromColor()

Definition at line 675 of file qpixmap.cpp.

References QImage::convertToFormat(), createMaskFromColor(), QImage::Format_ARGB32, QBitmap::fromImage(), QColor::rgba(), and toImage().

Referenced by createMaskFromColor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ data_ptr()

DataPtr & QPixmap::data_ptr ( )
inline

Definition at line 148 of file qpixmap.h.

◆ defaultDepth()

static int QPixmap::defaultDepth ( )
static

◆ depth()

int QPixmap::depth ( ) const

Returns the depth of the pixmap.

The pixmap depth is also called bits per pixel (bpp) or bit planes of a pixmap. A null pixmap has depth 0.

See also
defaultDepth(), {QPixmap::Pixmap Information}{Pixmap Information}

Definition at line 525 of file qpixmap.cpp.

Referenced by QPainter::begin(), and QCoreGraphicsPaintEngine::drawPixmap().

+ Here is the caller graph for this function:

◆ detach()

void QPixmap::detach ( )

Detaches the pixmap from shared pixmap data.

A pixmap is automatically detached by Qt whenever its contents are about to change. This is done in almost all QPixmap member functions that modify the pixmap (fill(), fromImage(), load(), etc.), and in QPainter::begin() on a pixmap.

There are two exceptions in which detach() must be called explicitly, that is when calling the handle() or the x11PictureHandle() function (only available on X11). Otherwise, any modifications done using system calls, will be performed on the shared data.

The detach() function returns immediately if there is just a single reference or if the pixmap has not been initialized yet.

Definition at line 1408 of file qpixmap.cpp.

References QPlatformPixmap::classId(), copy(), QImage::detach(), QImagePixmapCleanupHooks::executePlatformPixmapModificationHooks(), handle(), QRasterPlatformPixmap::image, and QPlatformPixmap::RasterClass.

Referenced by convertFromImage(), fill(), scroll(), setDevicePixelRatio(), and setMask().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deviceIndependentSize()

QSizeF QPixmap::deviceIndependentSize ( ) const

Returns the size of the pixmap in device independent pixels.

This value should be used when using the pixmap size in user interface size calculations.

The return value is equivalent to pixmap.size() / pixmap.devicePixelRatio().

Since
6.2

Definition at line 630 of file qpixmap.cpp.

Referenced by QPaintEngineEx::drawPixmap(), QWatermarkLabel::minimumSizeHint(), QSplashScreen::setPixmap(), and QShapedPixmapWindow::updateGeometry().

+ Here is the caller graph for this function:

◆ devicePixelRatio()

qreal QPixmap::devicePixelRatio ( ) const

Returns the device pixel ratio for the pixmap.

This is the ratio between {device pixels} and {device independent pixels}.

Use this function when calculating layout geometry based on the pixmap size: QSize layoutSize = image.size() / image.devicePixelRatio()

The default value is 1.0.

See also
setDevicePixelRatio(), QImageReader

Definition at line 580 of file qpixmap.cpp.

Referenced by QCursor::QCursor(), _q_paintIntoCache(), QQC2::QCommonStyle::drawControl(), QCommonStyle::drawControl(), QWindows11Style::drawControl(), QPainter::drawPixmap(), QPainter::drawPixmap(), QAppleIconEngine::scaledPixmap(), QAndroidPlatformIconEngine::scaledPixmap(), QWindowsIconEngine::scaledPixmap(), QWindowsDragCursorWindow::setPixmap(), and QShapedPixmapWindow::setPixmap().

+ Here is the caller graph for this function:

◆ devType()

int QPixmap::devType ( ) const
overridevirtual

Reimplemented from QPaintDevice.

Definition at line 251 of file qpixmap.cpp.

References QInternal::Pixmap.

◆ fill()

void QPixmap::fill ( const QColor & color = Qt::white)

Fills the pixmap with the given color.

The effect of this function is undefined when the pixmap is being painted on.

See also
{QPixmap::Pixmap Transformations}{Pixmap Transformations}

Definition at line 854 of file qpixmap.cpp.

References QPlatformPixmap::createCompatiblePlatformPixmap(), d, detach(), hasAlphaChannel(), isNull(), QPaintDevice::paintingActive(), and qWarning.

Referenced by AvatarExample::AvatarExample(), QCursor::QCursor(), _q_paintIntoCache(), QX11PaintEngine::drawTiledPixmap(), QtPrivate::QColorWell::mouseMoveEvent(), QtPrivate::QColorShowLabel::mouseMoveEvent(), qt_mac_draw_pattern(), ColorImageProvider::requestPixmap(), QAppleIconEngine::scaledPixmap(), QAndroidPlatformIconEngine::scaledPixmap(), QWindowsIconEngine::scaledPixmap(), QTabBarPrivate::setupMovableTab(), QHeaderViewPrivate::setupSectionIndicator(), QQC2::QWindowsXPStyle::standardIcon(), QWindowsVistaStyle::standardIcon(), QMacStyle::styleHint(), QQC2_NAMESPACE::QMacStyle::styleHint(), and QSGSoftwarePainterNode::update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromImage() [1/2]

QPixmap QPixmap::fromImage ( const QImage & image,
Qt::ImageConversionFlags flags = Qt::AutoColor )
static

Converts the given image to a pixmap using the specified flags to control the conversion.

The flags argument is a bitwise-OR of the \l{Qt::ImageConversionFlags}. Passing 0 for flags sets all the default options.

In case of monochrome and 8-bit images, the image is first converted to a 32-bit pixmap and then filled with the colors in the color table. If this is too expensive an operation, you can use QBitmap::fromImage() instead.

See also
fromImageReader(), toImage(), {QPixmap::Pixmap Conversion}{Pixmap Conversion}

Definition at line 1446 of file qpixmap.cpp.

References QPixmap(), QCoreApplication::instance(), QPlatformPixmap::PixmapType, QGuiApplicationPrivate::platformIntegration(), Q_UNLIKELY, and qWarning.

Referenced by QPixmap(), QSGSoftwarePixmapTexture::QSGSoftwarePixmapTexture(), QWaylandMouseTrackerPrivate::QWaylandMouseTrackerPrivate(), QDirectFBCursor::changeCursor(), convertFromImage(), Viewer::createImage(), createPixmapCursorFromData(), darkenPixmap(), QQC2_NAMESPACE::darkenPixmap(), QWindowsCursor::dragDefaultCursor(), QWindowsVistaStylePrivate::drawBackgroundThruNativeBuffer(), QQC2::QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(), QQC2::QCommonStyle::drawControl(), QQC2::QWindowsStyle::drawControl(), QCommonStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPaintEngine::drawImage(), QWindowsDirect2DPaintEngine::drawImage(), QWin32PrintEngine::drawPixmap(), QQC2::QCommonStyle::drawPrimitive(), QGtk3Interface::fileIcon(), QMacStyle::generatedIconPixmap(), QCommonStyle::generatedIconPixmap(), QQC2_NAMESPACE::QMacStyle::generatedIconPixmap(), QQC2::QCommonStyle::generatedIconPixmap(), QBsdFbScreen::grabWindow(), QEglFSScreen::grabWindow(), QIntegrityFbScreen::grabWindow(), QLinuxFbScreen::grabWindow(), QVncScreen::grabWindow(), QOffscreenBackingStore::grabWindow(), QCocoaScreen::grabWindow(), QHaikuScreen::grabWindow(), QIOSScreen::grabWindow(), QQnxScreen::grabWindow(), QMoviePrivate::infoForFrame(), QStyledItemDelegate::initStyleOption(), QtPrivate::QColorLuminancePicker::paintEvent(), QLabel::paintEvent(), QTexturedBrushData::pixmap(), QSvgIconEngine::pixmap(), qt_pixmapFromWinHBITMAP(), qt_pixmapFromWinHICON(), qt_xcb_pixmapFromXPixmap(), QAlphaWidget::render(), QtPrivate::QColorPicker::resizeEvent(), QAlphaWidget::run(), QItemDelegate::selectedPixmap(), QGtk3Storage::standardPixmap(), QQC2::QCommonStyle::standardPixmap(), QCommonStyle::standardPixmap(), QQuickDragAttachedPrivate::startDrag(), QQuickLabsPlatformIconLoader::toQIcon(), QPlatformPixmap::transformed(), and QX11PlatformPixmap::transformed().

+ Here is the call graph for this function:

◆ fromImage() [2/2]

QPixmap QPixmap::fromImage ( QImage && image,
Qt::ImageConversionFlags flags = Qt::AutoColor )
inlinestatic
Since
5.3 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Converts the given image to a pixmap without copying if possible.

Definition at line 91 of file qpixmap.h.

References QPlatformPixmap::fromImageInPlace().

+ Here is the call graph for this function:

◆ fromImageInPlace()

QPixmap QPixmap::fromImageInPlace ( QImage & image,
Qt::ImageConversionFlags flags = Qt::AutoColor )
staticprotected

Definition at line 1473 of file qpixmap.cpp.

References QPixmap(), QCoreApplication::instance(), QPlatformPixmap::PixmapType, QGuiApplicationPrivate::platformIntegration(), Q_UNLIKELY, and qWarning.

+ Here is the call graph for this function:

◆ fromImageReader()

QPixmap QPixmap::fromImageReader ( QImageReader * imageReader,
Qt::ImageConversionFlags flags = Qt::AutoColor )
static

Create a QPixmap from an image read directly from an imageReader.

The flags argument is a bitwise-OR of the \l{Qt::ImageConversionFlags}. Passing 0 for flags sets all the default options.

On some systems, reading an image directly to QPixmap can use less memory than reading a QImage to convert it to QPixmap.

See also
fromImage(), toImage(), {QPixmap::Pixmap Conversion}{Pixmap Conversion}

Definition at line 1500 of file qpixmap.cpp.

References QPixmap(), QCoreApplication::instance(), QPlatformPixmap::PixmapType, QGuiApplicationPrivate::platformIntegration(), Q_UNLIKELY, and qWarning.

+ Here is the call graph for this function:

◆ handle()

QPlatformPixmap * QPixmap::handle ( ) const

Definition at line 1515 of file qpixmap.cpp.

Referenced by QPixmapCacheEntry::QPixmapCacheEntry(), QX11PaintEngine::begin(), CapabilitiesToStateMask::canBlitterDrawPixmap(), CapabilitiesToStateMask::canBlitterDrawPixmapOpacity(), detach(), QWindowsDirect2DPaintEngine::drawPixmap(), and QWindowsDirect2DBackingStore::resize().

+ Here is the caller graph for this function:

◆ hasAlpha()

bool QPixmap::hasAlpha ( ) const

Referenced by QAlphaPaintEngine::drawPixmap(), and QSplashScreen::setPixmap().

+ Here is the caller graph for this function:

◆ hasAlphaChannel()

bool QPixmap::hasAlphaChannel ( ) const

Referenced by CapabilitiesToStateMask::canBlitterDrawPixmap(), fill(), QSGSoftwareLayer::hasAlphaChannel(), QSGSoftwarePixmapTexture::hasAlphaChannel(), QBrush::isOpaque(), QSGSoftwareNinePatchNode::isOpaque(), and QSGSoftwareRenderableNode::update().

+ Here is the caller graph for this function:

◆ height()

◆ isDetached()

bool QPixmap::isDetached ( ) const

Definition at line 961 of file qpixmap.cpp.

◆ isNull()

bool QPixmap::isNull ( ) const

Returns true if this is a null pixmap; otherwise returns false.

A null pixmap has zero width, zero height and no contents. You cannot draw in a null pixmap.

Definition at line 460 of file qpixmap.cpp.

Referenced by QCursor::QCursor(), QMessageBox::aboutQt(), QSvgIconEngine::actualSize(), QSvgIconEngine::addFile(), QPainter::begin(), QCoreGraphicsPaintEngine::begin(), bestSizeScaleMatch(), cacheKey(), convertFromImage(), copy(), createBitmapCursor(), QWindowsOleDropSource::createCursors(), createHIcon(), QWindowsCursor::dragDefaultCursor(), QPixmapStyle::drawCachedPixmap(), QQC2::QCommonStyle::drawControl(), QCommonStyle::drawControl(), QQC2::QWindowsXPStyle::drawControl(), QWindowsVistaStyle::drawControl(), QGraphicsScenePrivate::drawItemHelper(), QPainter::drawPixmap(), QCoreGraphicsPaintEngine::drawPixmap(), QWindowsDirect2DPaintEngine::drawPixmap(), QPainter::drawPixmap(), QPixmapStyle::drawSlider(), fill(), QXcbNativeBackingStore::flush(), QSplashScreenPrivate::handlePaintEvent(), QPixmapIconEngineEntry::isNull(), load(), QTextDocument::loadResource(), QQuickJSContext2DPrototype::method_drawImage(), QSGSoftwareImageNode::paint(), QShapedPixmapWindow::paintEvent(), QWizard::paintEvent(), PixmapEntry::pixmap(), QSvgIconEngine::pixmap(), QGraphicsEffectSource::pixmap(), QWindowsCursor::pixmapWindowCursor(), QQuickContext2DCommandBuffer::replay(), QWindowsDirect2DBackingStore::resize(), QXcbNativeBackingStore::resize(), save(), save(), QPixmapIconEngine::scaledPixmap(), QXcbNativeBackingStore::scroll(), scroll(), setDevicePixelRatio(), setMask(), QTexturedBrushData::setPixmap(), QWizardHeader::setup(), QMessageBoxPrivate::setupLayout(), QCocoaMessageDialog::show(), QWindowsSystemTrayIcon::showMessage(), QQC2::QCommonStyle::standardPixmap(), toImage(), QSGSoftwareInternalImageNode::update(), QShapedPixmapWindow::updateGeometry(), and QPixmapIconEngine::write().

◆ isQBitmap()

bool QPixmap::isQBitmap ( ) const

Returns true if this is a QBitmap; otherwise returns false.

Definition at line 447 of file qpixmap.cpp.

References QPlatformPixmap::BitmapType.

Referenced by QPainter::drawPixmap(), QEmulationPaintEngine::drawPixmap(), QAlphaPaintEngine::drawPixmap(), QPainter::drawPixmap(), QBrush::isOpaque(), load(), and QOpenGL2PaintEngineExPrivate::updateBrushUniforms().

+ Here is the caller graph for this function:

◆ load()

bool QPixmap::load ( const QString & fileName,
const char * format = nullptr,
Qt::ImageConversionFlags flags = Qt::AutoColor )

Loads a pixmap from the file with the given fileName.

Returns true if the pixmap was successfully loaded; otherwise invalidates the pixmap and returns false.

The loader attempts to read the pixmap using the specified format. If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.

The file name can either refer to an actual file on disk or to one of the application's embedded resources. See the \l{resources.html}{Resource System} overview for details on how to embed pixmaps and other resource files in the application's executable.

If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.

Note that QPixmaps are automatically added to the QPixmapCache when loaded from a file in main thread; the key used is internal and cannot be acquired.

See also
loadFromData(), {QPixmap::Reading and Writing Image Files}{Reading and Writing Image Files}

Definition at line 708 of file qpixmap.cpp.

References QPlatformPixmap::create(), QThread::currentThread(), fileName, QPixmapCache::find(), info, QPixmapCache::insert(), isNull(), isQBitmap(), QPlatformPixmap::PixmapType, qApp, QBitmap, and QTimeZone::UTC.

Referenced by QBitmap::QBitmap(), QPixmap(), QAndroidStyle::AndroidImageDrawable::draw(), QAndroidStyle::Android9PatchDrawable::draw(), QQuickCanvasItem::loadImage(), PixmapEntry::pixmap(), and src_gui_image_qpixmapcache::wrapper0().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadFromData() [1/2]

bool QPixmap::loadFromData ( const QByteArray & data,
const char * format = nullptr,
Qt::ImageConversionFlags flags = Qt::AutoColor )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Loads a pixmap from the binary data using the specified format and conversion flags.

Definition at line 163 of file qpixmap.h.

References loadFromData().

+ Here is the call graph for this function:

◆ loadFromData() [2/2]

bool QPixmap::loadFromData ( const uchar * data,
uint len,
const char * format = nullptr,
Qt::ImageConversionFlags flags = Qt::AutoColor )

Loads a pixmap from the len first bytes of the given binary data.

Returns true if the pixmap was loaded successfully; otherwise invalidates the pixmap and returns false.

The loader attempts to read the pixmap using the specified format. If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.

If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.

See also
load(), {QPixmap::Reading and Writing Image Files}{Reading and Writing Image Files}

Definition at line 765 of file qpixmap.cpp.

References QPlatformPixmap::create(), and QPlatformPixmap::PixmapType.

Referenced by QTextHtmlParserNode::applyBackgroundImage(), loadFromData(), and QTextDocument::loadResource().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mask()

QBitmap QPixmap::mask ( ) const

Returns true if this pixmap has an alpha channel, or has a mask, otherwise returns false.

See also
hasAlphaChannel(), mask()

Returns true if the pixmap has a format that respects the alpha channel, otherwise returns false.

See also
hasAlpha()

Extracts a bitmap mask from the pixmap's alpha channel.

Warning
This is potentially an expensive operation. The mask of the pixmap is extracted dynamically from the pixeldata.
See also
setMask(), {QPixmap::Pixmap Information}{Pixmap Information}

Referenced by QCursor::QCursor(), QWindowsCursor::createPixmapCursor(), main(), qt_pixmapToWinHICON(), QShapedPixmapWindow::setPixmap(), and QGraphicsPixmapItemPrivate::updateShape().

+ Here is the caller graph for this function:

◆ metric()

int QPixmap::metric ( PaintDeviceMetric ) const
overrideprotectedvirtual

Reimplemented from QPaintDevice.

◆ operator QVariant()

QPixmap::operator QVariant ( ) const

Returns the pixmap as a QVariant.

Definition at line 383 of file qpixmap.cpp.

References QVariant::fromValue().

+ Here is the call graph for this function:

◆ operator!()

bool QPixmap::operator! ( ) const
inline

Returns true if this is a null pixmap; otherwise returns false.

See also
isNull()

Definition at line 119 of file qpixmap.h.

References QPlatformPixmap::isNull().

+ Here is the call graph for this function:

◆ operator!=()

bool QPixmap::operator!= ( const QPixmap & ) const
delete

◆ operator=()

QPixmap & QPixmap::operator= ( const QPixmap & pixmap)

Assigns the given pixmap to this pixmap and returns a reference to this pixmap.

Move-assigns other to this QPixmap instance.

See also
copy(), QPixmap()
Since
5.2

Definition at line 350 of file qpixmap.cpp.

References QPaintDevice::paintingActive(), pixmap, and qWarning.

+ Here is the call graph for this function:

◆ operator==()

bool QPixmap::operator== ( const QPixmap & ) const
delete

◆ paintEngine()

QPaintEngine * QPixmap::paintEngine ( ) const
overridevirtual

Implements QPaintDevice.

◆ rect()

QRect QPixmap::rect ( ) const

Returns the pixmap's enclosing rectangle.

See also
{QPixmap::Pixmap Information}{Pixmap Information}

Definition at line 509 of file qpixmap.cpp.

Referenced by QMoviePrivate::_q_loadNextFrame(), _q_paintIntoCache(), copy(), QPainter::drawPixmap(), QBlitterPaintEngine::drawPixmap(), QPaintEngineEx::drawPixmap(), qt_mac_draw_pattern(), and scroll().

+ Here is the caller graph for this function:

◆ save() [1/2]

bool QPixmap::save ( const QString & fileName,
const char * format = nullptr,
int quality = -1 ) const

Saves the pixmap to the file with the given fileName using the specified image file format and quality factor.

Returns true if successful; otherwise returns false.

The quality factor must be in the range [0,100] or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed files, and -1 to use the default settings.

If format is \nullptr, an image format will be chosen from fileName's suffix.

See also
{QPixmap::Reading and Writing Image Files}{Reading and Writing Image Files}

Definition at line 807 of file qpixmap.cpp.

References fileName, and isNull().

Referenced by QDBusMenuItem::QDBusMenuItem(), and Viewer::saveImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save() [2/2]

bool QPixmap::save ( QIODevice * device,
const char * format = nullptr,
int quality = -1 ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This function writes a QPixmap to the given device using the specified image file format and quality factor.

This can be used, for example, to save a pixmap directly into a QByteArray:

QByteArray bytes;
QBuffer buffer(&bytes);
pixmap.save(&buffer, "PNG"); // writes pixmap into bytes in PNG format

Definition at line 825 of file qpixmap.cpp.

References device, and isNull().

+ Here is the call graph for this function:

◆ scaled() [1/2]

QPixmap QPixmap::scaled ( const QSize & s,
Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
Qt::TransformationMode mode = Qt::FastTransformation ) const

◆ scaled() [2/2]

QPixmap QPixmap::scaled ( int w,
int h,
Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
Qt::TransformationMode mode = Qt::FastTransformation ) const
inline

Definition at line 78 of file qpixmap.h.

References scaled().

Referenced by QWindowsOleDropSource::createCursors(), FinalWidget::mouseMoveEvent(), PixmapEntry::pixmap(), and QPixmapIconEngine::scaledPixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scaledToHeight()

QPixmap QPixmap::scaledToHeight ( int height,
Qt::TransformationMode mode = Qt::FastTransformation ) const

Returns a scaled copy of the image.

The returned image is scaled to the given height using the specified transformation mode. The width of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.

If height is 0 or negative, a null pixmap is returned.

See also
isNull(), {QPixmap::Pixmap Transformations}{Pixmap Transformations}

◆ scaledToWidth()

QPixmap Q_TRACE_INSTRUMENTQPixmap QPixmap::scaledToWidth ( int w,
Qt::TransformationMode mode = Qt::FastTransformation ) const

Returns a scaled copy of the image.

The returned image is scaled to the given width using the specified transformation mode. The height of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.

If width is 0 or negative, a null pixmap is returned.

See also
isNull(), {QPixmap::Pixmap Transformations}{Pixmap Transformations}

Definition at line 1063 of file qpixmap.cpp.

◆ scroll() [1/2]

void QPixmap::scroll ( int dx,
int dy,
const QRect & rect,
QRegion * exposed = nullptr )
Since
4.6

Scrolls the area rect of this pixmap by (dx, dy). The exposed region is left unchanged. You can optionally pass a pointer to an empty QRegion to get the region that is exposed by the scroll operation.

QPixmap pixmap("background.png");
QRegion exposed;
pixmap.scroll(10, 10, pixmap.rect(), &exposed);

You cannot scroll while there is an active painter on the pixmap.

See also
QWidget::scroll(), QGraphicsItem::scroll()

Definition at line 313 of file qpixmap.cpp.

References QPainter::CompositionMode_Source, detach(), QPainter::drawPixmap(), QPainter::end(), isNull(), painter, pix, rect(), QPainter::setCompositionMode(), QRegion::translated(), and QRect::translated().

+ Here is the call graph for this function:

◆ scroll() [2/2]

void QPixmap::scroll ( int dx,
int dy,
int x,
int y,
int width,
int height,
QRegion * exposed = nullptr )
inline
Since
4.6

This convenience function is equivalent to calling QPixmap::scroll(dx, dy, QRect(x, y, width, height), exposed).

See also
QWidget::scroll(), QGraphicsItem::scroll()

Definition at line 158 of file qpixmap.h.

References scroll().

Referenced by scroll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDevicePixelRatio()

void QPixmap::setDevicePixelRatio ( qreal scaleFactor)

Sets the device pixel ratio for the pixmap.

This is the ratio between image pixels and device-independent pixels.

The default scaleFactor is 1.0. Setting it to something else has two effects:

QPainters that are opened on the pixmap will be scaled. For example, painting on a 200x200 image if with a ratio of 2.0 will result in effective (device-independent) painting bounds of 100x100.

Code paths in Qt that calculate layout geometry based on the pixmap size will take the ratio into account: QSize layoutSize = pixmap.size() / pixmap.devicePixelRatio() The net effect of this is that the pixmap is displayed as high-DPI pixmap rather than a large pixmap (see \l{Drawing High Resolution Versions of Pixmaps and Images}).

See also
devicePixelRatio(), deviceIndependentSize()

Definition at line 608 of file qpixmap.cpp.

References detach(), and isNull().

Referenced by QWindowsOleDropSource::createCursors(), QGraphicsScenePrivate::drawItemHelper(), QCommonStylePrivate::iconFromWindowsTheme(), QAppleIconEngine::scaledPixmap(), QAndroidPlatformIconEngine::scaledPixmap(), QWindowsIconEngine::scaledPixmap(), QTabBarPrivate::setupMovableTab(), and QHeaderViewPrivate::setupSectionIndicator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMask()

void QPixmap::setMask ( const QBitmap & mask)

Sets a mask bitmap.

This function merges the mask with the pixmap's alpha channel. A pixel value of 1 on the mask means the pixmap's pixel is unchanged; a value of 0 means the pixel is transparent. The mask must have the same size as this pixmap.

Setting a null mask resets the mask, leaving the previously transparent pixels black. The effect of this function is undefined when the pixmap is being painted on.

Warning
This is potentially an expensive operation.
See also
mask(), {QPixmap::Pixmap Transformations}{Pixmap Transformations}, QBitmap

Definition at line 547 of file qpixmap.cpp.

References detach(), isNull(), QPaintDevice::paintingActive(), and qWarning.

Referenced by QCursor::QCursor(), QX11PlatformPixmap::transformed(), and src_gui_image_qpixmap::wrapper0().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

◆ swap()

void QPixmap::swap ( QPixmap & other)
inlinenoexcept
Since
4.8

Swaps pixmap other with this pixmap. This operation is very fast and never fails.

Definition at line 43 of file qpixmap.h.

References other().

Referenced by QBitmap::fromPixmap(), swap(), QBitmap::swap(), swap(), swap(), swap(), and swap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toImage()

QImage QPixmap::toImage ( ) const

Converts the pixmap to a QImage.

Returns a null image if the conversion fails.

If the pixmap has 1-bit depth, the returned image will also be 1 bit deep. Images with more bits will be returned in a format closely represents the underlying system. Usually this will be QImage::Format_ARGB32_Premultiplied for pixmaps with an alpha and QImage::Format_RGB32 or QImage::Format_RGB16 for pixmaps without alpha.

Note that for the moment, alpha masks on monochrome images are ignored.

See also
fromImage(), {QImage::Image Formats}{Image Formats}

Definition at line 412 of file qpixmap.cpp.

References isNull().

Referenced by QCursor::QCursor(), createBitmapCursor(), createHeuristicMask(), createMaskFromColor(), QCocoaDrag::drag(), QCoreGraphicsPaintEngine::drawPixmap(), QWindowsDirect2DPaintEngine::drawPixmap(), QSvgPaintEngine::drawPixmap(), QPdfEngine::drawPixmap(), QTexturedBrushData::image(), FinalWidget::mouseMoveEvent(), qt_pixmapToWinHICON(), QAlphaWidget::run(), QCocoaMessageDialog::show(), QMacStyle::styleHint(), QQC2_NAMESPACE::QMacStyle::styleHint(), QDirectFbBackingStore::toImage(), QXcbNativeBackingStore::toImage(), QSGSoftwareLayer::toImage(), and QSGSoftwarePainterNode::toImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transformed()

QPixmap QPixmap::transformed ( const QTransform & ,
Qt::TransformationMode mode = Qt::FastTransformation ) const

Referenced by QBitmap::transformed(), and QSGSoftwareInternalImageNode::update().

+ Here is the caller graph for this function:

◆ trueMatrix()

QTransform QPixmap::trueMatrix ( const QTransform & matrix,
int width,
int height )
static

Returns the actual matrix used for transforming a pixmap with the given width, height and matrix.

When transforming a pixmap using the transformed() function, the transformation matrix is internally adjusted to compensate for unwanted translation, i.e. transformed() returns the smallest pixmap containing all transformed points of the original pixmap. This function returns the modified matrix, which maps points correctly from the original pixmap into the new pixmap.

See also
transformed(), {QPixmap::Pixmap Transformations}{Pixmap Transformations}

Definition at line 436 of file qpixmap.cpp.

References QImage::trueMatrix().

Referenced by QWin32PrintEngine::drawPixmap(), and QX11PlatformPixmap::transformed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ width()

Friends And Related Symbol Documentation

◆ operator<<()

QDataStream & operator<< ( QDataStream & stream,
const QPixmap & pixmap )
related

Writes the given pixmap to the given stream as a PNG image.

Note that writing the stream to a file will not produce a valid image file.

See also
QPixmap::save(), {Serializing Qt Data Types}

Definition at line 927 of file qpixmap.cpp.

References pixmap.

◆ operator>> [1/2]

QDataStream & operator>> ( QDataStream & stream,
QPixmap & pixmap )
friend

Reads an image from the given stream into the given pixmap.

See also
QPixmap::load(), {Serializing Qt Data Types}

Definition at line 940 of file qpixmap.cpp.

◆ operator>>() [2/2]

QDataStream & operator>> ( QDataStream & stream,
QPixmap & pixmap )
related

Reads an image from the given stream into the given pixmap.

See also
QPixmap::load(), {Serializing Qt Data Types}

Definition at line 940 of file qpixmap.cpp.

◆ QBitmap

friend class QBitmap
friend

Definition at line 133 of file qpixmap.h.

Referenced by load().

◆ QOpenGLWidget

friend class QOpenGLWidget
friend

Definition at line 136 of file qpixmap.h.

◆ QPaintDevice

friend class QPaintDevice
friend

Definition at line 134 of file qpixmap.h.

◆ QPainter

friend class QPainter
friend

Definition at line 135 of file qpixmap.h.

◆ QPlatformPixmap

friend class QPlatformPixmap
friend

Definition at line 132 of file qpixmap.h.

◆ QRasterBuffer

friend class QRasterBuffer
friend

Definition at line 138 of file qpixmap.h.

◆ QWidgetPrivate

friend class QWidgetPrivate
friend

Definition at line 137 of file qpixmap.h.


The documentation for this class was generated from the following files: