Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QCanvasPixmap class provides a pixmap in a QCanvas. More...
#include <qcanvas.h>
Inherits QPixmap.
The pixmap is a QPixmap and can only be set in the constructor. There are three different constructors, one taking a QPixmap, one a QImage and one a file name that refers to a file in any supported file format (see QImageIO).
QCanvasPixmap can have a hotspot which is defined in terms of an (x, y) offset. When you create a QCanvasPixmap from a PNG file or from a QImage that has a QImage::offset(), the offset() is initialized appropriately, otherwise the constructor leaves it at (0, 0). You can set it later using setOffset(). When the QCanvasPixmap is used in a QCanvasSprite, the offset position is the point at QCanvasItem::x() and QCanvasItem::y(), not the top-left corner of the pixmap.
Note that for QCanvasPixmap objects created by a QCanvasSprite, the position of each QCanvasPixmap object is set so that the hotspot stays in the same position.
Like any other canvas item, canvas pixmaps can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().
See also QCanvasPixmapArray, QCanvasItem, QCanvasSprite, Graphics Classes and Image Processing Classes.
Returns the x-offset of the pixmap's hotspot.
See also setOffset().
Returns the y-offset of the pixmap's hotspot.
See also setOffset().
Sets the offset of the pixmap's hotspot to (x, y).
Warning: Do not call this function if any QCanvasSprites are currently showing this pixmap.
This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.
Copyright © 2002 Trolltech | Trademarks | Qt version 3.0.4
|