Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Fonctions  · 

QCanvasPixmap Class Reference
[canvas module]

The QCanvasPixmap class provides pixmaps for QCanvasSprites. More...

#include <qcanvas.h>

Inherits QPixmap.

List of all member functions.

Public Members


Detailed Description

The QCanvasPixmap class provides pixmaps for QCanvasSprites.

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. QCanvasSprites are used to show pixmaps on QCanvases 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.

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.

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.

int QCanvasPixmap::offsetX () const

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

See also setOffset().

int QCanvasPixmap::offsetY () const

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

See also setOffset().

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

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.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 3.0
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web