QCanvasPixmap(3qt)

NAME
QCanvasPixmap - Pixmap with an offset

#include <qcanvas.h>

Inherits QPixmap.

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

DESCRIPTION
The QCanvasPixmap class provides a pixmap with an offset.

QImage has an offset or "hot spot", but QPixmap does not. This class adds the notion of an offset to QPixmap as this is very useful for the canvas sprites where QCanvasPixmap is used. It also keeps a copy of the display mask for use in collision detection.

Note that PNG format files already have support for an offset.

See also QCanvasPixmapArray, QCanvasItem and QCanvasSprite.

MEMBER FUNCTION DOCUMENTATION

QCanvasPixmap::QCanvasPixmap ( const QImage & image )
Constructs a QCanvasPixmap from an image.

QCanvasPixmap::QCanvasPixmap ( const QPixmap & pm, QPoint offset )
Constructs a QCanvasPixmap from a pixmap and an offset.

QCanvasPixmap::QCanvasPixmap ( const QString & datafilename )
Constructs a QCanvasPixmap from an image file by loading it.

QCanvasPixmap::~QCanvasPixmap ()
Destructs the pixmap.

int QCanvasPixmap::offsetX () const
Returns the X-offset of the pixmap.

See also setOffset().

int QCanvasPixmap::offsetY () const
Returns the Y-offset of the pixmap.

See also setOffset().

void QCanvasPixmap::setOffset ( int x, int y )
Sets the offset to (x, y).

The offset position or "hot spot" defines the origin pixel in the image For example, if the offset is (10,5), it will be displayed drawn 10 pixels to the left of and 5 pixels above the actual (x,y) coordinate of the sprite.

SEE ALSO
http://doc.trolltech.com/qcanvaspixmap.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports make our job much simpler. Thank you.

In case of content or formattting problems with this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qcanvaspixmap.3qt) and the Qt version (2.3.5).