QCanvasPixmap(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– QCanvasPixmap β€” the 3qt era, bestie πŸ’–

okay so you're in the 3qt manual section and we're talking about QCanvasPixmap, which is literally the pixmaps-for-QCanvasSprites class. sit down, hydrate, let's go ✨


🌸 NAME 🌸

QCanvasPixmap β€” Pixmaps for QCanvasSprites πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <qcanvas.h>

Inherits QPixmap.

πŸ‘‘ Public Members

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

πŸ’… DESCRIPTION πŸ’…

The QCanvasPixmap class provides pixmaps for QCanvasSprites. no cap, that's the whole job description.

If you wanna show a single pixmap on a QCanvas, bestie, use a QCanvasSprite with just one pixmap. one (1) pixmap. that's it.

When pixmaps get inserted into a QCanvasPixmapArray they're held as QCanvasPixmaps. QCanvasSprites are what you use to show pixmaps on QCanvases, and they hold their pixmaps in a QCanvasPixmapArray. so if you retrieve a frame (a pixmap) from a QCanvasSprite, it comes back to you as a QCanvasPixmap. periodt.

The pixmap is a QPixmap and can only be set in the constructor. like, that's the vibe, that's the rule. there are three different constructors:

  • one taking a QPixmap
  • one taking a QImage
  • one taking 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 just leaves it at (0, 0) (default behavior, we love her). you can set it later using setOffset(). and 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. that trips people up EVERY time, iykyk 😭

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. iconic behavior honestly.

See also QCanvasPixmapArray, QCanvasItem, QCanvasSprite, Graphics Classes, and Image Processing Classes. πŸ’œ


πŸŽ€ MEMBER FUNCTION DOCUMENTATION πŸŽ€

QCanvasPixmap::QCanvasPixmap ( const QString & datafilename )

Constructs a QCanvasPixmap that uses the image stored in datafilename. yes queen, just hand her a filename.

QCanvasPixmap::QCanvasPixmap ( const QImage & image )

Constructs a QCanvasPixmap from the image image. straight from a QImage, no detours.

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

Constructs a QCanvasPixmap from the pixmap pm using the offset offset. pixmap + offset, the classic duo 🌈

QCanvasPixmap::~QCanvasPixmap ()

Destroys the pixmap. bye bestie πŸ’€ (affectionate)

int QCanvasPixmap::offsetX () const

Returns the x-offset of the pixmap's hotspot. that's the horizontal situation.

See also setOffset().

int QCanvasPixmap::offsetY () const

Returns the y-offset of the pixmap's hotspot. vertical vibes only.

See also setOffset().

void QCanvasPixmap::setOffset ( int x, int y )

Sets the offset of the pixmap's hotspot to (x, y). slay, now the hotspot lives where you want it.

⚠️ Warning: Do not call this function if any QCanvasSprites are currently showing this pixmap. fr fr, do NOT. this is one of those "i did it anyway and regretted it" situations, so just don't πŸ™ˆ

⭐ SEE ALSO ⭐


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. πŸ“œ (yes, actually read it, bestie)


✨ AUTHOR ✨

Generated automatically from the source code. not a human, just robot energy πŸ’€βœ¨


πŸ“ BUGS πŸ“

If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. 🫢 (genuinely, good bug reports are the love language of maintainers)

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. (we're the lowkey alternative route, and that's fine πŸ’…)

If you find errors in 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 (3.3.8). include both, don't make them guess, that's rude 😀


okay that's the whole page!! brought to you by Trolltech AS, dated 2 February 2007, from the 3qt era of the manual pages β€” this girl is old enough to vote but she still eats. mwah πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from