- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends

# QPixmap Class Reference

Search for all occurrences

## Detailed Description

Definition at line 71 of file qpixmap.h.

`#include <qpixmap.h>`

Inheritance diagram for QPixmap:
[legend]

List of all members.

## Public Types
typedef QExplicitlySharedDataPointer < QPixmapData > | DataPtr
## Public Member Functions
| QPixmap ()
| QPixmap (QPixmapData *data)
| QPixmap (int w, int h)
| QPixmap (const QSize &)
| QPixmap (const QString &fileName, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
| QPixmap (const char *const xpm[])
| QPixmap (const QPixmap &)
| ~QPixmap ()
QPixmap & | operator= (const QPixmap &)
| operator QVariant () const
bool | isNull () const
int | devType () const
int | width () const
int | height () const
QSize | size () const
QRect | rect () const
int | depth () const
void | fill (const QColor &fillColor=Qt::white)
void | fill (const QWidget *widget, const QPoint &ofs)
void | fill (const QWidget *widget, int xofs, int yofs)
QBitmap | mask () const
void | setMask (const QBitmap &)
QPixmap | alphaChannel () const
void | setAlphaChannel (const QPixmap &)
bool | hasAlpha () const
bool | hasAlphaChannel () const
QBitmap | createHeuristicMask (bool clipTight=true) const
QBitmap | createMaskFromColor (const QColor &maskColor) const
QBitmap | createMaskFromColor (const QColor &maskColor, Qt::MaskMode mode) const
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
QPixmap | scaledToHeight (int h, Qt::TransformationMode mode=Qt::FastTransformation) const
QPixmap | transformed (const QMatrix &, Qt::TransformationMode mode=Qt::FastTransformation) const
QPixmap | transformed (const QTransform &, Qt::TransformationMode mode=Qt::FastTransformation) const
QImage | toImage () const
bool | load (const QString &fileName, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
bool | loadFromData (const uchar *buf, uint len, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
bool | loadFromData (const QByteArray &data, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
bool | save (const QString &fileName, const char *format=0, int quality=-1) const
bool | save (QIODevice *device, const char *format=0, int quality=-1) const
bool | convertFromImage (const QImage &img, Qt::ImageConversionFlags flags=Qt::AutoColor)
QPixmap | copy (int x, int y, int width, int height) const
QPixmap | copy (const QRect &rect=QRect()) const
void | scroll (int dx, int dy, int x, int y, int width, int height, QRegion *exposed=0)
void | scroll (int dx, int dy, const QRect &rect, QRegion *exposed=0)
int | serialNumber () const
qint64 | cacheKey () const
bool | isDetached () const
void | detach ()
bool | isQBitmap () const
QPaintEngine * | paintEngine () const
bool | operator! () const
QPixmapData * | pixmapData () const
DataPtr & | data_ptr ()
## Static Public Member Functions
static int | defaultDepth ()
static QPixmap | grabWindow (WId, int x=0, int y=0, int w=-1, int h=-1)
static QPixmap | grabWidget (QWidget *widget, const QRect &rect)
static QPixmap | grabWidget (QWidget *widget, int x=0, int y=0, int w=-1, int h=-1)
static QMatrix | trueMatrix (const QMatrix &m, int w, int h)
static QTransform | trueMatrix (const QTransform &m, int w, int h)
static QPixmap | fromImage (const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
static QPixmap | fromImageReader (QImageReader *imageReader, Qt::ImageConversionFlags flags=Qt::AutoColor)
## Protected Member Functions
int | metric (PaintDeviceMetric) const
## Friends
class | QPixmapData
class | QX11PixmapData
class | QMacPixmapData
class | QS60PixmapData
class | QBitmap
class | QPaintDevice
class | QPainter
class | QGLWidget
class | QX11PaintEngine
class | QCoreGraphicsPaintEngine
class | QWidgetPrivate
class | QRasterBuffer
Q_GUI_EXPORT QDataStream & | operator>> (QDataStream &, QPixmap &)
Q_GUI_EXPORT qint64 | qt_pixmap_id (const QPixmap &pixmap)

## Member Typedef Documentation

typedef QExplicitlySharedDataPointer<QPixmapData> DataPtr

Search for all occurrences

Reimplemented in QBitmap.

Definition at line 286 of file qpixmap.h.

## Constructor & Destructor Documentation

QPixmap | ( |  | ) |

QPixmap | ( | QPixmapData * | data | ) | `[explicit]`

QPixmap | ( | int | w,
|  | int | h
| ) |  |

QPixmap | ( | const QSize & |  | ) |

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

QPixmap | ( | const char *const | xpm[] | ) |

QPixmap | ( | const QPixmap & |  | ) |

~QPixmap | ( |  | ) |

## Member Function Documentation

QPixmap& operator= | ( | const QPixmap & |  | ) |

Reimplemented in QBitmap.

operator QVariant | ( |  | ) | const

Reimplemented in QBitmap.

bool isNull | ( |  | ) | const

Search for all occurrences

int devType | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QPaintDevice.

int width | ( |  | ) | const

Search for all occurrences

Reimplemented from QPaintDevice.

int height | ( |  | ) | const

Search for all occurrences

Reimplemented from QPaintDevice.

QSize size | ( |  | ) | const

Search for all occurrences

QRect rect | ( |  | ) | const

Search for all occurrences

int depth | ( |  | ) | const

Search for all occurrences

Reimplemented from QPaintDevice.

static int defaultDepth | ( |  | ) | `[static]`

Search for all occurrences

void fill | ( | const QColor & | fillColor = `Qt::white` | ) |

Search for all occurrences

void fill | ( | const QWidget * | widget,
|  | const QPoint & | ofs
| ) |  |

Search for all occurrences

void fill | ( | const QWidget * | widget,
|  | int | xofs,
|  | int | yofs
| ) |  | `[inline]`

Search for all occurrences

Definition at line 101 of file qpixmap.h.

    { fill(widget, QPoint(xofs, yofs)); }

QBitmap mask | ( |  | ) | const

Search for all occurrences

void setMask | ( | const QBitmap & |  | ) |

Search for all occurrences

QPixmap alphaChannel | ( |  | ) | const

Search for all occurrences

void setAlphaChannel | ( | const QPixmap & |  | ) |

Search for all occurrences

bool hasAlpha | ( |  | ) | const

Search for all occurrences

bool hasAlphaChannel | ( |  | ) | const

Search for all occurrences

QBitmap createHeuristicMask | ( | bool | clipTight = `true` | ) | const

Search for all occurrences

QBitmap createMaskFromColor | ( | const QColor & | maskColor | ) | const

Search for all occurrences

QBitmap createMaskFromColor | ( | const QColor & | maskColor,
|  | Qt::MaskMode | mode
| ) |  | const

Search for all occurrences

static QPixmap grabWindow | ( | WId | ,
|  | int | x = `0`,
|  | int | y = `0`,
|  | int | w = `-1`,
|  | int | h = `-1`
| ) |  | `[static]`

Search for all occurrences

static QPixmap grabWidget | ( | QWidget * | widget,
|  | const QRect & | rect
| ) |  | `[static]`

Search for all occurrences

static QPixmap grabWidget | ( | QWidget * | widget,
|  | int | x = `0`,
|  | int | y = `0`,
|  | int | w = `-1`,
|  | int | h = `-1`
| ) |  | `[inline, static]`

Search for all occurrences

Definition at line 120 of file qpixmap.h.

        { return grabWidget(widget, QRect(x, y, w, h)); }

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

Search for all occurrences

Definition at line 124 of file qpixmap.h.

            { return scaled(QSize(w, h), aspectMode, mode); }

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

Search for all occurrences

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

Search for all occurrences

QPixmap scaledToHeight | ( | int | h,
|  | Qt::TransformationMode | mode = `Qt::FastTransformation`
| ) |  | const

Search for all occurrences

QPixmap transformed | ( | const QMatrix & | ,
|  | Qt::TransformationMode | mode = `Qt::FastTransformation`
| ) |  | const

Search for all occurrences

static QMatrix trueMatrix | ( | const QMatrix & | m,
|  | int | w,
|  | int | h
| ) |  | `[static]`

Search for all occurrences

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

Search for all occurrences

static QTransform trueMatrix | ( | const QTransform & | m,
|  | int | w,
|  | int | h
| ) |  | `[static]`

Search for all occurrences

QImage toImage | ( |  | ) | const

Search for all occurrences

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

Search for all occurrences

Reimplemented in QBitmap.

static QPixmap fromImageReader | ( | QImageReader * | imageReader,
|  | Qt::ImageConversionFlags | flags = `Qt::AutoColor`
| ) |  | `[static]`

Search for all occurrences

bool load | ( | const QString & | fileName,
|  | const char * | format = `0`,
|  | Qt::ImageConversionFlags | flags = `Qt::AutoColor`
| ) |  |

Search for all occurrences

bool loadFromData | ( | const uchar * | buf,
|  | uint | len,
|  | const char * | format = `0`,
|  | Qt::ImageConversionFlags | flags = `Qt::AutoColor`
| ) |  |

Search for all occurrences

bool loadFromData | ( | const QByteArray & | data,
|  | const char * | format = `0`,
|  | Qt::ImageConversionFlags | flags = `Qt::AutoColor`
| ) |  | `[inline]`

Search for all occurrences

Definition at line 302 of file qpixmap.h.

    {
        return loadFromData(reinterpret_cast<const uchar *>(buf.constData()), buf.size(), format, flags);
    }

bool save | ( | const QString & | fileName,
|  | const char * | format = `0`,
|  | int | quality = `-1`
| ) |  | const

Search for all occurrences

bool save | ( | QIODevice * | device,
|  | const char * | format = `0`,
|  | int | quality = `-1`
| ) |  | const

Search for all occurrences

bool convertFromImage | ( | const QImage & | img,
|  | Qt::ImageConversionFlags | flags = `Qt::AutoColor`
| ) |  |

Search for all occurrences

QPixmap copy | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 292 of file qpixmap.h.

    {
        return copy(QRect(ax, ay, awidth, aheight));
    }

QPixmap copy | ( | const QRect & | rect = `QRect()` | ) | const

Search for all occurrences

void scroll | ( | int | dx,
|  | int | dy,
|  | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | QRegion * | exposed = `0`
| ) |  | `[inline]`

Search for all occurrences

Definition at line 297 of file qpixmap.h.

    {
        scroll(dx, dy, QRect(ax, ay, awidth, aheight), exposed);
    }

void scroll | ( | int | dx,
|  | int | dy,
|  | const QRect & | rect,
|  | QRegion * | exposed = `0`
| ) |  |

Search for all occurrences

int serialNumber | ( |  | ) | const

Search for all occurrences

qint64 cacheKey | ( |  | ) | const

Search for all occurrences

bool isDetached | ( |  | ) | const

Search for all occurrences

void detach | ( |  | ) |

Search for all occurrences

bool isQBitmap | ( |  | ) | const

Search for all occurrences

QPaintEngine* paintEngine | ( |  | ) | const `[virtual]`

Search for all occurrences

Implements QPaintDevice.

bool operator! | ( | void |  | ) | const `[inline]`

Definition at line 216 of file qpixmap.h.

    { return isNull(); }

int metric | ( | PaintDeviceMetric |  | ) | const `[protected, virtual]`

Search for all occurrences

Reimplemented from QPaintDevice.

QPixmapData* pixmapData | ( |  | ) | const

Search for all occurrences

DataPtr& data_ptr | ( |  | ) | `[inline]`

Search for all occurrences

Definition at line 287 of file qpixmap.h.

    { return data; }

## Friends And Related Function Documentation

friend class QPixmapData `[friend]`

Search for all occurrences

Definition at line 265 of file qpixmap.h.

friend class QX11PixmapData `[friend]`

Search for all occurrences

Definition at line 266 of file qpixmap.h.

friend class QMacPixmapData `[friend]`

Search for all occurrences

Definition at line 267 of file qpixmap.h.

friend class QS60PixmapData `[friend]`

Search for all occurrences

Definition at line 268 of file qpixmap.h.

friend class QBitmap `[friend]`

Search for all occurrences

Definition at line 269 of file qpixmap.h.

friend class QPaintDevice `[friend]`

Search for all occurrences

Definition at line 270 of file qpixmap.h.

friend class QPainter `[friend]`

Search for all occurrences

Reimplemented from QPaintDevice.

Definition at line 271 of file qpixmap.h.

friend class QGLWidget `[friend]`

Search for all occurrences

Definition at line 272 of file qpixmap.h.

friend class QX11PaintEngine `[friend]`

Search for all occurrences

Reimplemented from QPaintDevice.

Definition at line 273 of file qpixmap.h.

friend class QCoreGraphicsPaintEngine `[friend]`

Search for all occurrences

Definition at line 274 of file qpixmap.h.

friend class QWidgetPrivate `[friend]`

Search for all occurrences

Definition at line 275 of file qpixmap.h.

friend class QRasterBuffer `[friend]`

Search for all occurrences

Definition at line 276 of file qpixmap.h.

Q_GUI_EXPORT QDataStream& operator>> | ( | QDataStream & | ,
|  | QPixmap & |
| ) |  | `[friend]`

Q_GUI_EXPORT qint64 qt_pixmap_id | ( | const QPixmap & | pixmap | ) | `[friend]`

Search for all occurrences

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

- QtGui/qpixmap.h

QPixmap QPixmap QPixmap QPixmap QPixmap QPixmap QPixmap QPixmap QPixmap QPixmap
QPixmap QPixmap QPixmap QPixmap QPixmap QPixmap QPixmap QPixmap QPixmap QPixmap