Eneboo - Documentación para desarrolladores
Métodos públicos | Amigas
Referencia de la Clase QCanvasPixmap

The QCanvasPixmap class provides pixmaps for QCanvasSprites.canvasIf you want to show a single pixmap on a QCanvas use a QCanvasSprite with just one pixmap. Más...

#include <qcanvas.h>

Diagrama de herencias de QCanvasPixmap
QPixmap QPixmap Qt QPaintDevice Qt QPaintDevice Qt QPaintDevice Qt QPaintDevice

Lista de todos los miembros.

Métodos públicos

 QCanvasPixmap (const QString &datafilename)
 QCanvasPixmap (const QImage &image)
 QCanvasPixmap (const QPixmap &, const QPoint &hotspot)
 ~QCanvasPixmap ()
int offsetX () const
int offsetY () const
void setOffset (int x, int y)
 QCanvasPixmap (const QString &datafilename)
 QCanvasPixmap (const QImage &image)
 QCanvasPixmap (const QPixmap &, const QPoint &hotspot)
 ~QCanvasPixmap ()
int offsetX () const
int offsetY () const
void setOffset (int x, int y)

Amigas

class QCanvasSprite
class QCanvasPixmapArray
bool qt_testCollision (const QCanvasSprite *s1, const QCanvasSprite *s2)
bool qt_testCollision (const QCanvasSprite *s1, const QCanvasSprite *s2)

Descripción detallada

The QCanvasPixmap class provides pixmaps for QCanvasSprites.

canvas

If you want to show a single pixmap on a QCanvas use a QCanvasSprite with just one pixmap.

When pixmaps are inserted into a QCanvasPixmapArray they are held as QCanvasPixmaps. {QCanvasSprite}s are used to show pixmaps on {QCanvas}es and hold their pixmaps in a QCanvasPixmapArray. If you retrieve a frame (pixmap) from a QCanvasSprite it will be returned as a QCanvasPixmap.

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.

Ver también:
QCanvasPixmapArray QCanvasItem QCanvasSprite

Documentación del constructor y destructor

QCanvasPixmap::QCanvasPixmap ( const QString datafilename)

Constructs a QCanvasPixmap that uses the image stored in datafilename.

QCanvasPixmap::QCanvasPixmap ( const QImage image)

Constructs a QCanvasPixmap from the image image.

QCanvasPixmap::QCanvasPixmap ( const QPixmap pm,
const QPoint offset 
)

Constructs a QCanvasPixmap from the pixmap pm using the offset offset.

QCanvasPixmap::~QCanvasPixmap ( )

Destroys the pixmap.

QCanvasPixmap::QCanvasPixmap ( const QString datafilename)
QCanvasPixmap::QCanvasPixmap ( const QImage image)
QCanvasPixmap::QCanvasPixmap ( const QPixmap ,
const QPoint hotspot 
)
QCanvasPixmap::~QCanvasPixmap ( )

Documentación de las funciones miembro

int QCanvasPixmap::offsetX ( ) const [inline]

Returns the x-offset of the pixmap's hotspot.

Ver también:
setOffset()
int QCanvasPixmap::offsetX ( ) const [inline]
int QCanvasPixmap::offsetY ( ) const [inline]
int QCanvasPixmap::offsetY ( ) const [inline]

Returns the y-offset of the pixmap's hotspot.

Ver también:
setOffset()
void QCanvasPixmap::setOffset ( int  x,
int  y 
) [inline]

Sets the offset of the pixmap's hotspot to (x, y).

Atención:
Do not call this function if any QCanvasSprites are currently showing this pixmap.
void QCanvasPixmap::setOffset ( int  x,
int  y 
) [inline]

Documentación de las funciones relacionadas y clases amigas

QCanvasSprite [friend]
bool qt_testCollision ( const QCanvasSprite s1,
const QCanvasSprite s2 
) [friend]
bool qt_testCollision ( const QCanvasSprite s1,
const QCanvasSprite s2 
) [friend]

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'