|  | Home · Overviews · Examples

# QGraphicsPixmapItem Class Reference
[com.trolltech.qt.gui module]

The `QGraphicsPixmapItem` class provides a pixmap item that you can add to a `QGraphicsScene`. More...

Inherits .

## Detailed Description

The `QGraphicsPixmapItem` class provides a pixmap item that you can add to a `QGraphicsScene`.

To set the item's pixmap, pass a `QPixmap` to `QGraphicsPixmapItem`'s constructor, or call the `setPixmap` function. The `pixmap` function returns the current pixmap.

`QGraphicsPixmapItem` uses pixmap's optional alpha mask to provide a reasonable implementation of `boundingRect`, `shape`, and `contains`.

The pixmap is drawn at the item's (0, 0) coordinate, as returned by `offset`. You can change the drawing offset by calling `setOffset`.

You can set the pixmap's transformation mode by calling `setTransformationMode`. By default, Qt::FastTransformation is used, which provides fast, non-smooth scaling. Qt::SmoothTransformation enables QPainter::SmoothPixmapTransform on the painter, and the quality depends on the platform and viewport. The result is usually not as good as calling QPixmap::scale() directly. Call `transformationMode` to get the current transformation mode for the item.

See also `QGraphicsPathItem`, `QGraphicsRectItem`, `QGraphicsEllipseItem`, `QGraphicsTextItem`, `QGraphicsPolygonItem`, `QGraphicsLineItem`, and The Graphics View Framework.