|Q3CanvasPixmap(const QString & datafilename)|
|Q3CanvasPixmap(const QImage & image)|
|Q3CanvasPixmap(const QPixmap & pm, const QPoint & offset)|
|void||setOffset(int x, int y)|
Additional Inherited Members
The Q3CanvasPixmap class provides pixmaps for Q3CanvasSprites.
When pixmaps are inserted into a Q3CanvasPixmapArray they are held as Q3CanvasPixmaps. Q3CanvasSprites are used to show pixmaps on Q3Canvases and hold their pixmaps in a Q3CanvasPixmapArray. If you retrieve a frame (pixmap) from a Q3CanvasSprite it will be returned as a Q3CanvasPixmap.
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 QImageReader).
Q3CanvasPixmap can have a hotspot which is defined in terms of an (x, y) offset. When you create a Q3CanvasPixmap 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 Q3CanvasPixmap is used in a Q3CanvasSprite, the offset position is the point at Q3CanvasItem::x() and Q3CanvasItem::y(), not the top-left corner of the pixmap.
Member Function Documentation
Q3CanvasPixmap::Q3CanvasPixmap(const QString & datafilename)
Constructs a Q3CanvasPixmap that uses the image stored in datafilename.
Q3CanvasPixmap::Q3CanvasPixmap(const QImage & image)
Constructs a Q3CanvasPixmap from the image image.
Constructs a Q3CanvasPixmap from the pixmap pm using the offset offset.
Destroys the pixmap.
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 Q3CanvasSprites are currently showing this pixmap.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.