Eneboo - Documentación para desarrolladores
Clases | Tipos públicos | Métodos públicos | Métodos públicos estáticos | Métodos protegidos | Atributos protegidos | Amigas | Funciones relacionadas
Referencia de la Clase QPixmap

The QPixmap class is an off-screen, pixel-based paint device. Más...

#include <qpixmap.h>

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

Lista de todos los miembros.

Clases

class  QPixmapData
 The QPixmap::QPixmapData class is an internal class. Más...

Tipos públicos

enum  ColorMode {
  Auto, Color, Mono, Auto,
  Color, Mono
}
enum  Optimization {
  DefaultOptim, NoOptim, MemoryOptim = NoOptim, NormalOptim,
  BestOptim, DefaultOptim, NoOptim, MemoryOptim = NoOptim,
  NormalOptim, BestOptim
}
enum  ColorMode {
  Auto, Color, Mono, Auto,
  Color, Mono
}
enum  Optimization {
  DefaultOptim, NoOptim, MemoryOptim = NoOptim, NormalOptim,
  BestOptim, DefaultOptim, NoOptim, MemoryOptim = NoOptim,
  NormalOptim, BestOptim
}

Métodos públicos

 QPixmap ()
 QPixmap (const QImage &image)
 QPixmap (int w, int h, int depth=-1, Optimization=DefaultOptim)
 QPixmap (const QSize &, int depth=-1, Optimization=DefaultOptim)
 QPixmap (const QString &fileName, const char *format=0, ColorMode mode=Auto)
 QPixmap (const QString &fileName, const char *format, int conversion_flags)
 QPixmap (const char *xpm[])
 QPixmap (const QByteArray &data)
 QPixmap (const QPixmap &)
 ~QPixmap ()
QPixmapoperator= (const QPixmap &)
QPixmapoperator= (const QImage &)
bool isNull () const
int width () const
int height () const
QSize size () const
QRect rect () const
int depth () const
void fill (const QColor &fillColor=Qt::white)
void fill (const QWidget *, int xofs, int yofs)
void fill (const QWidget *, const QPoint &ofs)
void resize (int width, int height)
void resize (const QSize &)
const QBitmapmask () const
void setMask (const QBitmap &)
bool selfMask () const
bool hasAlpha () const
bool hasAlphaChannel () const
QBitmap createHeuristicMask (bool clipTight=TRUE) const
QPixmap xForm (const QWMatrix &) const
QImage convertToImage () const
bool convertFromImage (const QImage &, ColorMode mode=Auto)
bool convertFromImage (const QImage &, int conversion_flags)
bool load (const QString &fileName, const char *format=0, ColorMode mode=Auto)
bool load (const QString &fileName, const char *format, int conversion_flags)
bool loadFromData (const uchar *buf, uint len, const char *format=0, ColorMode mode=Auto)
bool loadFromData (const uchar *buf, uint len, const char *format, int conversion_flags)
bool loadFromData (const QByteArray &data, const char *format=0, int conversion_flags=0)
bool save (const QString &fileName, const char *format, int quality=-1) const
bool save (QIODevice *device, const char *format, int quality=-1) const
int serialNumber () const
Optimization optimization () const
void setOptimization (Optimization)
virtual void detach ()
bool isQBitmap () const
 QPixmap ()
 QPixmap (const QImage &image)
 QPixmap (int w, int h, int depth=-1, Optimization=DefaultOptim)
 QPixmap (const QSize &, int depth=-1, Optimization=DefaultOptim)
 QPixmap (const QString &fileName, const char *format=0, ColorMode mode=Auto)
 QPixmap (const QString &fileName, const char *format, int conversion_flags)
 QPixmap (const char *xpm[])
 QPixmap (const QByteArray &data)
 QPixmap (const QPixmap &)
 ~QPixmap ()
QPixmapoperator= (const QPixmap &)
QPixmapoperator= (const QImage &)
bool isNull () const
int width () const
int height () const
QSize size () const
QRect rect () const
int depth () const
void fill (const QColor &fillColor=Qt::white)
void fill (const QWidget *, int xofs, int yofs)
void fill (const QWidget *, const QPoint &ofs)
void resize (int width, int height)
void resize (const QSize &)
const QBitmapmask () const
void setMask (const QBitmap &)
bool selfMask () const
bool hasAlpha () const
bool hasAlphaChannel () const
QBitmap createHeuristicMask (bool clipTight=TRUE) const
QPixmap xForm (const QWMatrix &) const
QImage convertToImage () const
bool convertFromImage (const QImage &, ColorMode mode=Auto)
bool convertFromImage (const QImage &, int conversion_flags)
bool load (const QString &fileName, const char *format=0, ColorMode mode=Auto)
bool load (const QString &fileName, const char *format, int conversion_flags)
bool loadFromData (const uchar *buf, uint len, const char *format=0, ColorMode mode=Auto)
bool loadFromData (const uchar *buf, uint len, const char *format, int conversion_flags)
bool loadFromData (const QByteArray &data, const char *format=0, int conversion_flags=0)
bool save (const QString &fileName, const char *format, int quality=-1) const
bool save (QIODevice *device, const char *format, int quality=-1) const
int serialNumber () const
Optimization optimization () const
void setOptimization (Optimization)
virtual void detach ()
bool isQBitmap () const

Métodos públicos estáticos

static int defaultDepth ()
static QPixmap fromMimeSource (const QString &abs_name)
static QPixmap grabWindow (WId, int x=0, int y=0, int w=-1, int h=-1)
static QPixmap grabWidget (QWidget *widget, int x=0, int y=0, int w=-1, int h=-1)
static QWMatrix trueMatrix (const QWMatrix &, int w, int h)
static const char * imageFormat (const QString &fileName)
static Optimization defaultOptimization ()
static void setDefaultOptimization (Optimization)
static int defaultDepth ()
static QPixmap fromMimeSource (const QString &abs_name)
static QPixmap grabWindow (WId, int x=0, int y=0, int w=-1, int h=-1)
static QPixmap grabWidget (QWidget *widget, int x=0, int y=0, int w=-1, int h=-1)
static QWMatrix trueMatrix (const QWMatrix &, int w, int h)
static const char * imageFormat (const QString &fileName)
static Optimization defaultOptimization ()
static void setDefaultOptimization (Optimization)

Métodos protegidos

 QPixmap (int w, int h, const uchar *data, bool isXbitmap)
int metric (int) const
 QPixmap (int w, int h, const uchar *data, bool isXbitmap)
int metric (int) const

Atributos protegidos

QPixmap::QPixmapDatadata

Amigas

class QBitmap
class QPaintDevice
class QPainter
class QGLWidget
Q_EXPORT void bitBlt (QPaintDevice *, int, int, const QPaintDevice *, int, int, int, int, RasterOp, bool)
Q_EXPORT void bitBlt (QPaintDevice *, int, int, const QImage *src, int, int, int, int, int conversion_flags)
Q_EXPORT void copyBlt (QPixmap *dst, int dx, int dy, const QPixmap *src, int sx, int sy, int sw, int sh)
Q_EXPORT void bitBlt (QPaintDevice *, int, int, const QPaintDevice *, int, int, int, int, RasterOp, bool)
Q_EXPORT void bitBlt (QPaintDevice *, int, int, const QImage *src, int, int, int, int, int conversion_flags)
Q_EXPORT void copyBlt (QPixmap *dst, int dx, int dy, const QPixmap *src, int sx, int sy, int sw, int sh)

Funciones relacionadas

(Observar que estas no son funciones miembro.)

QDataStreamoperator<< (QDataStream &s, const QPixmap &pixmap)
QDataStreamoperator>> (QDataStream &s, QPixmap &pixmap)

Descripción detallada

The QPixmap class is an off-screen, pixel-based paint device.

QPixmap is one of the two classes Qt provides for dealing with images; the other is QImage. QPixmap is designed and optimized for drawing; QImage is designed and optimized for I/O and for direct pixel access/manipulation. There are (slow) functions to convert between QImage and QPixmap: convertToImage() and convertFromImage().

One common use of the QPixmap class is to enable smooth updating of widgets. Whenever something complex needs to be drawn, you can use a pixmap to obtain flicker-free drawing, like this:

1 Create a pixmap with the same size as the widget. Fill the pixmap with the widget background color. Paint the pixmap. bitBlt() the pixmap contents onto the widget.

Pixel data in a pixmap is internal and is managed by the underlying window system. Pixels can be accessed only through QPainter functions, through bitBlt(), and by converting the QPixmap to a QImage.

You can easily display a QPixmap on the screen using QLabel::setPixmap(). For example, all the QButton subclasses support pixmap use.

The QPixmap class uses copy-on-write, so it is practical to pass QPixmap objects by value.

You can retrieve the width(), height(), depth() and size() of a pixmap. The enclosing rectangle is given by rect(). Pixmaps can be filled with fill() and resized with resize(). You can create and set a mask with createHeuristicMask() and setMask(). Use selfMask() to see if the pixmap is identical to its mask.

In addition to loading a pixmap from file using load() you can also loadFromData(). You can control optimization with setOptimization() and obtain a transformed version of the pixmap using xForm()

Note regarding Windows 95 and 98: on Windows 9x the system crashes if you create more than about 1000 pixmaps, independent of the size of the pixmaps or installed RAM. Windows NT-systems (including 2000, XP and following versions) do not have the same limitation, but depending on the graphics equipment the system will fail to allocate pixmap objects at some point (due to system running out of GDI resources).

Qt tries to work around the resource limitation. If you set the pixmap optimization to QPixmap::MemoryOptim and the width of your pixmap is less than or equal to 128 pixels, Qt stores the pixmap in a way that is very memory-efficient when there are many pixmaps.

If your application uses dozens or hundreds of pixmaps (for example on tool bar buttons and in popup menus), and you plan to run it on Windows 95 or Windows 98, we recommend using code like this:

        QPixmap::setDefaultOptimization( QPixmap::MemoryOptim );
        while ( ... ) {
            // load tool bar pixmaps etc.
            QPixmap *pixmap = new QPixmap(fileName);
        }
        QPixmap::setDefaultOptimization( QPixmap::NormalOptim );

In general it is recommended to make as much use of QPixmap's implicit sharing and the QPixmapCache as possible.

Ver también:
QBitmap, QImage, QImageIO, Shared Classes

Documentación de las enumeraciones miembro de la clase

This enum type defines the color modes that exist for converting QImage objects to QPixmap.

Auto Select Color or Mono on a case-by-case basis. Color Always create colored pixmaps. Mono Always create bitmaps.

Valores de enumeraciones:
Auto 
Color 
Mono 
Auto 
Color 
Mono 
Valores de enumeraciones:
Auto 
Color 
Mono 
Auto 
Color 
Mono 
Valores de enumeraciones:
DefaultOptim 
NoOptim 
MemoryOptim 
NormalOptim 
BestOptim 
DefaultOptim 
NoOptim 
MemoryOptim 
NormalOptim 
BestOptim 

QPixmap has the choice of optimizing for speed or memory in a few places; the best choice varies from pixmap to pixmap but can generally be derived heuristically. This enum type defines a number of optimization modes that you can set for any pixmap to tweak the speed/memory tradeoffs:

DefaultOptim Whatever QPixmap::defaultOptimization() returns. A pixmap with this optimization will have whatever the current default optimization is. If the default optimization is changed using setDefaultOptimization(), then this will not effect any pixmaps that have already been created.

NoOptim No optimization (currently the same as MemoryOptim).

MemoryOptim Optimize for minimal memory use on Windows 9x and X11 systems.

NormalOptim Optimize for typical usage. Often uses more memory than MemoryOptim, and is often faster.

BestOptim Optimize for pixmaps that are drawn very often and where performance is critical. Generally uses more memory than NormalOptim and may provide a little more speed.

We recommend using DefaultOptim.

Valores de enumeraciones:
DefaultOptim 
NoOptim 
MemoryOptim 
NormalOptim 
BestOptim 
DefaultOptim 
NoOptim 
MemoryOptim 
NormalOptim 
BestOptim 

Documentación del constructor y destructor

QPixmap::QPixmap ( )

Constructs a null pixmap.

Ver también:
isNull()
QPixmap::QPixmap ( const QImage image)

Constructs a pixmap from the QImage image.

Ver también:
convertFromImage()
QPixmap::QPixmap ( int  w,
int  h,
int  depth = -1,
Optimization  optimization = DefaultOptim 
)

Constructs a pixmap with w width, h height and depth bits per pixel. The pixmap is optimized in accordance with the optimization value.

The contents of the pixmap is uninitialized.

The depth can be either 1 (monochrome) or the depth of the current video mode. If depth is negative, then the hardware depth of the current video mode will be used.

If either w or h is zero, a null pixmap is constructed.

Ver también:
isNull() QPixmap::Optimization
QPixmap::QPixmap ( const QSize size,
int  depth = -1,
Optimization  optimization = DefaultOptim 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

Constructs a pixmap of size size, depth bits per pixel, optimized in accordance with the optimization value.

QPixmap::QPixmap ( const QString fileName,
const char *  format = 0,
ColorMode  mode = Auto 
)

Constructs a pixmap from the file fileName. If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap.

The fileName, format and mode parameters are passed on to load(). This means that the data in fileName is not compiled into the binary. If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

Ver también:
QPixmap::ColorMode isNull(), load(), loadFromData(), save(), imageFormat()
QPixmap::QPixmap ( const QString fileName,
const char *  format,
int  conversion_flags 
)

Constructs a pixmap from the file fileName. If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap.

The fileName, format and conversion_flags parameters are passed on to load(). This means that the data in fileName is not compiled into the binary. If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

If the image needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the conversion_flags to specify how you'd prefer this to happen.

Ver también:
Qt::ImageConversionFlags isNull(), load(), loadFromData(), save(), imageFormat()
QPixmap::QPixmap ( const char *  xpm[])

Constructs a pixmap from xpm, which must be a valid XPM image.

Errors are silently ignored.

Note that it's possible to squeeze the XPM variable a little bit by using an unusual declaration:

        static const char * const start_xpm[]={
            "16 15 8 1",
            "a c #cec6bd",
        ....

The extra const makes the entire definition read-only, which is slightly more efficient (for example, when the code is in a shared library) and ROMable when the application is to be stored in ROM.

In order to use that sort of declaration you must cast the variable back to {const char **} when you create the QPixmap.

QPixmap::QPixmap ( const QByteArray img_data)

Constructs a pixmaps by loading from img_data. The data can be in any image format supported by Qt.

Ver también:
loadFromData()
QPixmap::QPixmap ( const QPixmap pixmap)

Constructs a pixmap that is a copy of pixmap.

QPixmap::~QPixmap ( )

Destroys the pixmap.

QPixmap::QPixmap ( int  w,
int  h,
const uchar bits,
bool  isXbitmap 
) [protected]

Constructs a monochrome pixmap which is initialized with the data in bits. This constructor is protected and used by the QBitmap class.

Constructs a monochrome pixmap, with width w and height h, that is initialized with the data in bits. The isXbitmap indicates whether the data is an X bitmap and defaults to FALSE. This constructor is protected and used by the QBitmap class.

QPixmap::QPixmap ( )
QPixmap::QPixmap ( const QImage image)
QPixmap::QPixmap ( int  w,
int  h,
int  depth = -1,
Optimization  = DefaultOptim 
)
QPixmap::QPixmap ( const QSize ,
int  depth = -1,
Optimization  = DefaultOptim 
)
QPixmap::QPixmap ( const QString fileName,
const char *  format = 0,
ColorMode  mode = Auto 
)
QPixmap::QPixmap ( const QString fileName,
const char *  format,
int  conversion_flags 
)
QPixmap::QPixmap ( const char *  xpm[])
QPixmap::QPixmap ( const QByteArray data)
QPixmap::QPixmap ( const QPixmap )
QPixmap::~QPixmap ( )
QPixmap::QPixmap ( int  w,
int  h,
const uchar data,
bool  isXbitmap 
) [protected]

Documentación de las funciones miembro

bool QPixmap::convertFromImage ( const QImage image,
ColorMode  mode = Auto 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Converts image and sets this pixmap using color mode mode. Returns TRUE if successful; otherwise returns FALSE.

Ver también:
QPixmap::ColorMode
bool QPixmap::convertFromImage ( const QImage ,
ColorMode  mode = Auto 
)
bool QPixmap::convertFromImage ( const QImage ,
int  conversion_flags 
)
bool QPixmap::convertFromImage ( const QImage img,
int  conversion_flags 
)

Converts image img and sets this pixmap. Returns TRUE if successful; otherwise returns FALSE.

The conversion_flags argument is a bitwise-OR of the {Qt::ImageConversionFlags}. Passing 0 for conversion_flags sets all the default options.

Note that even though a QPixmap with depth 1 behaves much like a QBitmap, isQBitmap() returns FALSE.

If a pixmap with depth 1 is painted with color0 and color1 and converted to an image, the pixels painted with color0 will produce pixel index 0 in the image and those painted with color1 will produce pixel index 1.

Ver también:
convertToImage(), isQBitmap(), QImage::convertDepth(), defaultDepth(), QImage::hasAlphaBuffer()
QImage QPixmap::convertToImage ( ) const
QImage QPixmap::convertToImage ( ) const

Converts the pixmap to an image. Returns a null image if the operation failed.

If the pixmap has 1 bit depth, the returned image will also be 1 bits deep. If the pixmap has 2-8 bit depth, the returned image has 8 bit depth. If the pixmap has greater than 8 bit depth, the returned image has 32 bit depth.

Bug:
Does not support 2 or 4 bit display hardware.
Bug:
Alpha masks on monochrome images are ignored.
Ver también:
convertFromImage()

Converts the pixmap to a QImage. Returns a null image if it fails.

If the pixmap has 1-bit depth, the returned image will also be 1 bit deep. If the pixmap has 2- to 8-bit depth, the returned image has 8-bit depth. If the pixmap has greater than 8-bit depth, the returned image has 32-bit depth.

Note that for the moment, alpha masks on monochrome images are ignored.

Ver también:
convertFromImage()
QBitmap QPixmap::createHeuristicMask ( bool  clipTight = TRUE) const
QBitmap QPixmap::createHeuristicMask ( bool  clipTight = TRUE) const

Creates and returns a heuristic mask for this pixmap. It works by selecting a color from one of the corners and then chipping away pixels of that color, starting at all the edges.

The mask may not be perfect but it should be reasonable, so you can do things such as the following:

    pm->setMask( pm->createHeuristicMask() );

This function is slow because it involves transformation to a QImage, non-trivial computations and a transformation back to a QBitmap.

If clipTight is TRUE the mask is just large enough to cover the pixels; otherwise, the mask is larger than the data pixels.

Ver también:
QImage::createHeuristicMask()
int QPixmap::defaultDepth ( ) [static]

Returns the default pixmap depth, i.e. the depth a pixmap gets if -1 is specified.

Ver también:
depth()
static int QPixmap::defaultDepth ( ) [static]
QPixmap::Optimization QPixmap::defaultOptimization ( ) [static]

Returns the default pixmap optimization setting.

Ver también:
setDefaultOptimization(), setOptimization(), optimization()
static Optimization QPixmap::defaultOptimization ( ) [static]
int QPixmap::depth ( ) const [inline]

Returns the depth of the pixmap.

The pixmap depth is also called bits per pixel (bpp) or bit planes of a pixmap. A null pixmap has depth 0.

Ver también:
defaultDepth(), isNull(), QImage::convertDepth()
int QPixmap::depth ( ) const [inline]
void QPixmap::detach ( ) [virtual]

Special-purpose function that detaches the pixmap from shared pixmap data.

A pixmap is automatically detached by Qt whenever its contents is about to change. This is done in all QPixmap member functions that modify the pixmap (fill(), resize(), convertFromImage(), load() etc.), in bitBlt() for the destination pixmap and in QPainter::begin() on a pixmap.

It is possible to modify a pixmap without letting Qt know. You can first obtain the system-dependent handle and then call system-specific functions (for instance BitBlt under Windows) that modifies the pixmap contents. In this case, you can call detach() to cut the pixmap loose from other pixmaps that share data with this one.

detach() returns immediately if there is just a single reference or if the pixmap has not been initialized yet.

This is a special-purpose function that detaches the pixmap from shared pixmap data.

A pixmap is automatically detached by Qt whenever its contents is about to change. This is done in all QPixmap member functions that modify the pixmap (fill(), resize(), convertFromImage(), load(), etc.), in bitBlt() for the destination pixmap and in QPainter::begin() on a pixmap.

It is possible to modify a pixmap without letting Qt know. You can first obtain the system-dependent handle() and then call system-specific functions (for instance, BitBlt under Windows) that modify the pixmap contents. In such cases, you can call detach() to cut the pixmap loose from other pixmaps that share data with this one.

detach() returns immediately if there is just a single reference or if the pixmap has not been initialized yet.

virtual void QPixmap::detach ( ) [virtual]
void QPixmap::fill ( const QColor fillColor = Qt::white)

Fills the pixmap with the color fillColor.

Fills the pixmap with the color fillColor.

void QPixmap::fill ( const QWidget widget,
int  xofs,
int  yofs 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

Fills the pixmap with the widget's background color or pixmap. If the background is empty, nothing is done. xofs, yofs is an offset in the widget.

void QPixmap::fill ( const QWidget widget,
const QPoint ofs 
) [inline]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

Fills the pixmap with the widget's background color or pixmap. If the background is empty, nothing is done.

The ofs point is an offset in the widget.

The point ofs is a point in the widget's coordinate system. The pixmap's top-left pixel will be mapped to the point ofs in the widget. This is significant if the widget has a background pixmap; otherwise the pixmap will simply be filled with the background color of the widget.

Example:

    void CuteWidget::paintEvent( QPaintEvent *e )
    {
        QRect ur = e->rect();            // rectangle to update
        QPixmap pix( ur.size() );        // Pixmap for double-buffering
        pix.fill( this, ur.topLeft() );  // fill with widget background

        QPainter p( &pix );
        p.translate( -ur.x(), -ur.y() ); // use widget coordinate system
                                         // when drawing on pixmap
        //    ... draw on pixmap ...

        p.end();

        bitBlt( this, ur.topLeft(), &pix );
    }
void QPixmap::fill ( const QColor fillColor = Qt::white)
void QPixmap::fill ( const QWidget ,
int  xofs,
int  yofs 
)
void QPixmap::fill ( const QWidget ,
const QPoint ofs 
)
static QPixmap QPixmap::fromMimeSource ( const QString abs_name) [static]
QPixmap QPixmap::fromMimeSource ( const QString abs_name) [static]

Convenience function. Gets the data associated with the absolute name abs_name from the default mime source factory and decodes it to a pixmap.

Ver también:
QMimeSourceFactory, QImage::fromMimeSource(), QImageDrag::decode()
static QPixmap QPixmap::grabWidget ( QWidget widget,
int  x = 0,
int  y = 0,
int  w = -1,
int  h = -1 
) [static]
QPixmap QPixmap::grabWidget ( QWidget widget,
int  x = 0,
int  y = 0,
int  w = -1,
int  h = -1 
) [static]

Creates a pixmap and paints widget in it.

If the widget has any children, then they are also painted in the appropriate positions.

If you specify x, y, w or h, only the rectangle you specify is painted. The defaults are 0, 0 (top-left corner) and -1,-1 (which means the entire widget).

(If w is negative, the function copies everything to the right border of the window. If h is negative, the function copies everything to the bottom of the window.)

If widget is 0, or if the rectangle defined by x, y, the modified w and the modified h does not overlap the {widget}->rect(), this function will return a null QPixmap.

This function actually asks widget to paint itself (and its children to paint themselves). QPixmap::grabWindow() grabs pixels off the screen, which is a bit faster and picks up exactly what's on-screen. This function works by calling paintEvent() with painter redirection turned on. If there are overlaying windows, grabWindow() will see them, but not this function.

If there is overlap, it returns a pixmap of the size you want, containing a rendering of widget. If the rectangle you ask for is a superset of widget, the areas outside widget are covered with the widget's background.

If an error occurs when trying to grab the widget, such as the size of the widget being too large to fit in memory, an isNull() pixmap is returned.

Ver también:
grabWindow() QPainter::redirect() QWidget::paintEvent()
static QPixmap QPixmap::grabWindow ( WId  ,
int  x = 0,
int  y = 0,
int  w = -1,
int  h = -1 
) [static]
QPixmap QPixmap::grabWindow ( WId  window,
int  x = 0,
int  y = 0,
int  w = -1,
int  h = -1 
) [static]

Grabs the contents of a window and makes a pixmap out of it. Returns the pixmap.

The arguments (x,y) specify the offset in the window, while (w,h) specify the width and height of the area to be copied.

If w is negative, the function copies everything to the right border of the window. If h is negative, the function copies everything to the bottom of the window.

Note that grabWindows() grabs pixels from the screen, not from the window. This means that If there is another window partially or entirely over the one you grab, you get pixels from the overlying window too.

Note also that the mouse cursor is generally not grabbed.

The reason we use a window identifier and not a QWidget is to enable grabbing of windows that are not part of the application, window system frames, and so on.

Atención:
Grabbing an area outside the screen is not safe in general. This depends on the underlying window system.
Ver también:
grabWidget()

Grabs the contents of the window window and makes a pixmap out of it. Returns the pixmap.

The arguments (x, y) specify the offset in the window, whereas (w, h) specify the width and height of the area to be copied.

If w is negative, the function copies everything to the right border of the window. If h is negative, the function copies everything to the bottom of the window.

Note that grabWindow() grabs pixels from the screen, not from the window. If there is another window partially or entirely over the one you grab, you get pixels from the overlying window, too.

Note also that the mouse cursor is generally not grabbed.

The reason we use a window identifier and not a QWidget is to enable grabbing of windows that are not part of the application, window system frames, and so on.

Atención:
Grabbing an area outside the screen is not safe in general. This depends on the underlying window system.
X11 only: If window is not the same depth as the root window and another window partially or entirely obscures the one you grab, you will not get pixels from the overlying window. The contests of the obscured areas in the pixmap are undefined and uninitialized.
Ver también:
grabWidget()
bool QPixmap::hasAlpha ( ) const

Returns TRUE if painting with this pixmap might not necessarily paint all pixels in its rectangular area.

Returns TRUE this pixmap has an alpha channel or a mask.

Ver también:
hasAlphaChannel() mask()
bool QPixmap::hasAlpha ( ) const
bool QPixmap::hasAlphaChannel ( ) const

Returns TRUE if the pixmap has an alpha channel; otherwise it returns FALSE.

NOTE: If the pixmap has a mask but not alpha channel, this function returns FALSE.

Ver también:
hasAlpha() mask()
bool QPixmap::hasAlphaChannel ( ) const
int QPixmap::height ( ) const [inline]

Returns the height of the pixmap.

Ver también:
width(), size(), rect()
int QPixmap::height ( ) const [inline]
static const char* QPixmap::imageFormat ( const QString fileName) [static]
const char * QPixmap::imageFormat ( const QString fileName) [static]

Returns a string that specifies the image format of the file fileName, or 0 if the file cannot be read or if the format cannot be recognized.

The QImageIO documentation lists the supported image formats.

Ver también:
load(), save()
bool QPixmap::isNull ( ) const [inline]

Returns TRUE if this is a null pixmap; otherwise returns FALSE.

A null pixmap has zero width, zero height and no contents. You cannot draw in a null pixmap or bitBlt() anything to it.

Resizing an existing pixmap to (0, 0) makes a pixmap into a null pixmap.

Ver también:
resize()
bool QPixmap::isNull ( ) const
bool QPixmap::isQBitmap ( ) const
bool QPixmap::isQBitmap ( ) const [inline]

Returns TRUE if this is a QBitmap; otherwise returns FALSE.

bool QPixmap::load ( const QString fileName,
const char *  format = 0,
ColorMode  mode = Auto 
)
bool QPixmap::load ( const QString fileName,
const char *  format,
int  conversion_flags 
)
bool QPixmap::load ( const QString fileName,
const char *  format,
int  conversion_flags 
)

Loads a pixmap from the file fileName at runtime. Returns TRUE if successful; otherwise returns FALSE.

If format is specified, the loader attempts to read the pixmap using the specified format. If format is not specified (default), the loader reads a few bytes from the header to guess the file's format.

See the convertFromImage() documentation for a description of the conversion_flags argument.

The QImageIO documentation lists the supported image formats and explains how to add extra formats.

Ver también:
loadFromData(), save(), imageFormat(), QImage::load(), QImageIO
bool QPixmap::load ( const QString fileName,
const char *  format = 0,
ColorMode  mode = Auto 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Loads a pixmap from the file fileName at runtime.

If format is specified, the loader attempts to read the pixmap using the specified format. If format is not specified (default), the loader reads a few bytes from the header to guess the file's format.

The mode is used to specify the color mode of the pixmap.

Ver también:
QPixmap::ColorMode
bool QPixmap::loadFromData ( const uchar buf,
uint  len,
const char *  format = 0,
ColorMode  mode = Auto 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Loads a pixmap from the binary data in buf (len bytes) using color mode mode. Returns TRUE if successful; otherwise returns FALSE.

If format is specified, the loader attempts to read the pixmap using the specified format. If format is not specified (default), the loader reads a few bytes from the header to guess the file's format.

Ver también:
QPixmap::ColorMode
bool QPixmap::loadFromData ( const uchar buf,
uint  len,
const char *  format,
int  conversion_flags 
)

Loads a pixmap from the binary data in buf (len bytes). Returns TRUE if successful; otherwise returns FALSE.

If format is specified, the loader attempts to read the pixmap using the specified format. If format is not specified (default), the loader reads a few bytes from the header to guess the file's format.

See the convertFromImage() documentation for a description of the conversion_flags argument.

The QImageIO documentation lists the supported image formats and explains how to add extra formats.

Ver también:
load(), save(), imageFormat(), QImage::loadFromData(), QImageIO
bool QPixmap::loadFromData ( const QByteArray buf,
const char *  format = 0,
int  conversion_flags = 0 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

bool QPixmap::loadFromData ( const uchar buf,
uint  len,
const char *  format = 0,
ColorMode  mode = Auto 
)
bool QPixmap::loadFromData ( const QByteArray data,
const char *  format = 0,
int  conversion_flags = 0 
)
bool QPixmap::loadFromData ( const uchar buf,
uint  len,
const char *  format,
int  conversion_flags 
)
const QBitmap* QPixmap::mask ( ) const
const QBitmap * QPixmap::mask ( ) const [inline]

Returns the mask bitmap, or 0 if no mask has been set.

Ver también:
setMask(), QBitmap, hasAlpha()
int QPixmap::metric ( int  ) const [protected, virtual]

Internal virtual function that returns paint device metrics.

Please use the QPaintDeviceMetrics class instead.

Reimplementado de QPaintDevice.

int QPixmap::metric ( int  m) const [protected, virtual]

Internal implementation of the virtual QPaintDevice::metric() function.

Use the QPaintDeviceMetrics class instead.

Internal implementation of the virtual QPaintDevice::metric() function.

Use the QPaintDeviceMetrics class instead.

m is the metric to get.

Reimplementado de QPaintDevice.

QPixmap& QPixmap::operator= ( const QPixmap )

Reimplementado en QBitmap y QBitmap.

QPixmap & QPixmap::operator= ( const QImage image)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Converts the image image to a pixmap that is assigned to this pixmap. Returns a reference to the pixmap.

Ver también:
convertFromImage().

Reimplementado en QBitmap y QBitmap.

QPixmap& QPixmap::operator= ( const QImage )

Reimplementado en QBitmap y QBitmap.

QPixmap & QPixmap::operator= ( const QPixmap pixmap)

Assigns the pixmap pixmap to this pixmap and returns a reference to this pixmap.

Reimplementado en QBitmap y QBitmap.

Optimization QPixmap::optimization ( ) const
QPixmap::Optimization QPixmap::optimization ( ) const [inline]

Returns the optimization setting for this pixmap.

The default optimization setting is QPixmap::NormalOptim. You may change this settings in two ways:

Ver también:
setOptimization(), setDefaultOptimization(), defaultOptimization()

Returns the optimization setting for this pixmap.

The default optimization setting is QPixmap::NormalOptim. You can change this setting in two ways: Call setDefaultOptimization() to set the default optimization for all new pixmaps. Call setOptimization() to set the optimization for individual pixmaps.

Ver también:
setOptimization(), setDefaultOptimization(), defaultOptimization()
QRect QPixmap::rect ( ) const [inline]
QRect QPixmap::rect ( ) const [inline]

Returns the enclosing rectangle (0,0,width(),height()) of the pixmap.

Ver también:
width(), height(), size()
void QPixmap::resize ( int  width,
int  height 
)
void QPixmap::resize ( int  w,
int  h 
)

Resizes the pixmap to w width and h height. If either w or h is 0, the pixmap becomes a null pixmap.

If both w and h are greater than 0, a valid pixmap is created. New pixels will be uninitialized (random) if the pixmap is expanded.

void QPixmap::resize ( const QSize )
void QPixmap::resize ( const QSize size) [inline]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

Resizes the pixmap to size size.

bool QPixmap::save ( QIODevice device,
const char *  format,
int  quality = -1 
) const
bool QPixmap::save ( QIODevice device,
const char *  format,
int  quality = -1 
) const

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. This function writes a QPixmap to the QIODevice, device. This can be used, for example, to save a pixmap directly into a QByteArray:

    QPixmap pixmap;
    QByteArray ba;
    QBuffer buffer( ba );
    buffer.open( IO_WriteOnly );
    pixmap.save( &buffer, "PNG" ); // writes pixmap into ba in PNG format
bool QPixmap::save ( const QString fileName,
const char *  format,
int  quality = -1 
) const
bool QPixmap::save ( const QString fileName,
const char *  format,
int  quality = -1 
) const

Saves the pixmap to the file fileName using the image file format format and a quality factor quality. quality must be in the range [0,100] or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed files, and -1 to use the default settings. Returns TRUE if successful; otherwise returns FALSE.

Ver también:
load(), loadFromData(), imageFormat(), QImage::save(), QImageIO
bool QPixmap::selfMask ( ) const
bool QPixmap::selfMask ( ) const [inline]

Returns TRUE if the pixmap's mask is identical to the pixmap itself; otherwise returns FALSE.

Ver también:
mask()
int QPixmap::serialNumber ( ) const
int QPixmap::serialNumber ( ) const [inline]

Returns a number that uniquely identifies the contents of this QPixmap object. This means that multiple QPixmap objects can have the same serial number as long as they refer to the same contents.

An example of where this is useful is for caching QPixmaps.

Ver también:
QPixmapCache
void QPixmap::setDefaultOptimization ( Optimization  optimization) [static]

Sets the default pixmap optimization.

All new pixmaps that are created will use this default optimization. You may also set optimization for individual pixmaps using the setOptimization() function.

The initial default optimization setting is QPixmap::Normal.

Ver también:
defaultOptimization(), setOptimization(), optimization()
static void QPixmap::setDefaultOptimization ( Optimization  ) [static]
void QPixmap::setMask ( const QBitmap newmask)

Sets a mask bitmap.

The newmask bitmap defines the clip mask for this pixmap. Every pixel in newmask corresponds to a pixel in this pixmap. Pixel value 1 means opaque and pixel value 0 means transparent. The mask must have the same size as this pixmap.

Atención:
Setting the mask on a pixmap will cause any alpha channel data to be cleared. For example:
        QPixmap alpha( "image-with-alpha.png" );
        QPixmap alphacopy = alpha;
        alphacopy.setMask( *alphacopy.mask() );
Now, alpha and alphacopy are visually different.

Setting a null mask resets the mask.

Ver también:
mask(), createHeuristicMask(), QBitmap
void QPixmap::setMask ( const QBitmap )
void QPixmap::setOptimization ( Optimization  )
void QPixmap::setOptimization ( Optimization  optimization)

Sets pixmap drawing optimization for this pixmap.

The optimization setting affects pixmap operations, in particular drawing of transparent pixmaps (bitBlt() a pixmap with a mask set) and pixmap transformations (the xForm() function).

Pixmap optimization involves keeping intermediate results in a cache buffer and use the data in the cache to speed up bitBlt() and xForm(). The cost is more memory consumption, up to twice as much as an unoptimized pixmap.

Use the setDefaultOptimization() to change the default optimization for all new pixmaps.

Ver también:
optimization(), setDefaultOptimization(), defaultOptimization()

Sets pixmap drawing optimization for this pixmap.

The optimization setting affects pixmap operations, in particular drawing of transparent pixmaps (bitBlt() a pixmap with a mask set) and pixmap transformations (the xForm() function).

Pixmap optimization involves keeping intermediate results in a cache buffer and using the cache to speed up bitBlt() and xForm(). The cost is more memory consumption, up to twice as much as an unoptimized pixmap.

Use the setDefaultOptimization() to change the default optimization for all new pixmaps.

Ver también:
optimization(), setDefaultOptimization(), defaultOptimization()
QSize QPixmap::size ( ) const [inline]

Returns the size of the pixmap.

Ver también:
width(), height(), rect()
QSize QPixmap::size ( ) const [inline]
static QWMatrix QPixmap::trueMatrix ( const QWMatrix ,
int  w,
int  h 
) [static]
QWMatrix QPixmap::trueMatrix ( const QWMatrix matrix,
int  w,
int  h 
) [static]

Returns the actual matrix used for transforming a pixmap with w width and h height and matrix matrix.

When transforming a pixmap with xForm(), the transformation matrix is internally adjusted to compensate for unwanted translation, i.e. xForm() returns the smallest pixmap containing all transformed points of the original pixmap.

This function returns the modified matrix, which maps points correctly from the original pixmap into the new pixmap.

Ver también:
xForm(), QWMatrix
int QPixmap::width ( ) const [inline]
int QPixmap::width ( ) const [inline]

Returns the width of the pixmap.

Ver también:
height(), size(), rect()
QPixmap QPixmap::xForm ( const QWMatrix matrix) const

Returns a copy of the pixmap that is transformed using matrix.

Qt uses this function to implement rotated text on window systems that do not support such complex features.

Example of how to manually draw a rotated text at (100,200) in a widget:

    char    *str = "Trolls R Qt"; // text to be drawn
    QFont    f( "Charter", 24 ); // use Charter 24pt font
    QPixmap  pm( 8, 8 );
    QPainter p;
    QRect    r;    // text bounding rectangle
    QPoint   bl;   // text baseline position

    p.begin( &pm );   // first get the bounding
    p.setFont( f );   //   text rectangle
    r = p.fontMetrics().boundingRect(str);
    bl = -r.topLeft();   // get baseline position
    p.end();

    pm.resize( r.size() );  // resize to fit the text
    pm.fill( white );   // fills pm with white
    p.begin( &pm );   // begin painting pm
    p.setFont( f );   // set the font
    p.setPen( blue );   // set blue text color
    p.drawText( bl, str );  // draw the text
    p.end();    // painting done

    QWMatrix m;    // transformation matrix
    m.rotate( -33.4 );   // rotate coordinate system
    QPixmap rp = pm.xForm( m );  // rp is rotated pixmap

    QWMatrix t = QPixmap::trueMatrix( m, pm.width(), pm.height() );
    int x, y;
    t.map( bl.x(),bl.y(), &x,&y ); // get pm's baseline pos in rp

    bitBlt( myWidget, 100-x, 200-y, // blt rp into a widget
     &rp, 0, 0, -1, -1 );

This example outlines how Qt implements rotated text under X11. The font calculation is the most tedious part. The rotation itself is only 3 lines of code.

If you want to draw rotated text, you do not have to implement all the code above. The code below does exactly the same thing as the example above, except that it uses a QPainter.

    char    *str = "Trolls R Qt"; // text to be drawn
    QFont    f( "Charter", 24 ); // use Charter 24pt font
    QPainter p;

    p.begin( myWidget );
    p.translate( 100, 200 );  // translates coord system
    p.rotate( -33.4 );   // rotates it counterclockwise
    p.setFont( f );
    p.drawText( 0, 0, str );
    p.end();
Bug:
2 and 4 bits pixmaps are not supported.
Ver también:
trueMatrix(), QWMatrix, QPainter::setWorldMatrix()

Returns a copy of the pixmap that is transformed using matrix. The original pixmap is not changed.

The transformation matrix is internally adjusted to compensate for unwanted translation, i.e. xForm() returns the smallest image that contains all the transformed points of the original image.

This function is slow because it involves transformation to a QImage, non-trivial computations and a transformation back to a QPixmap.

Ver también:
trueMatrix(), QWMatrix, QPainter::setWorldMatrix() QImage::xForm()

Reimplementado en QBitmap y QBitmap.

QPixmap QPixmap::xForm ( const QWMatrix ) const

Reimplementado en QBitmap y QBitmap.


Documentación de las funciones relacionadas y clases amigas

Q_EXPORT void bitBlt ( QPaintDevice dst,
int  dx,
int  dy,
const QPaintDevice src,
int  sx,
int  sy,
int  sw,
int  sh,
RasterOp  rop,
bool  ignoreMask 
) [friend]

This function copies a block of pixels from one paint device to another (bitBlt means bit block transfer).

  • dst is the paint device to copy to.
  • dx and dy is the position to copy to.
  • src is the paint device to copy from.
  • sx and sy is the position to copy from.
  • sw and sh is the width and height of the block to be copied.
  • rop defines the raster operation to be used when copying.

If sw is 0 or sh is 0, then bitBlt will do nothing.

If sw is negative, then bitBlt calculates sw = src->width - sx. If sh is negative, then bitBlt calculates sh = src->height - sy.

The rop argument can be one of:

  • CopyROP: dst = src.
  • OrROP: dst = src OR dst.
  • XorROP: dst = src XOR dst.
  • NotAndROP: dst = (NOT src) AND dst
  • NotCopyROP: dst = NOT src
  • NotOrROP: dst = (NOT src) OR dst
  • NotXorROP: dst = (NOT src) XOR dst
  • AndROP dst = src AND dst
  • NotROP: dst = NOT dst
  • ClearROP: dst = 0
  • SetROP: dst = 1
  • NopROP: dst = dst
  • AndNotROP: dst = src AND (NOT dst)
  • OrNotROP: dst = src OR (NOT dst)
  • NandROP: dst = NOT (src AND dst)
  • NorROP: dst = NOT (src OR dst)

The ignoreMask argument (default FALSE) applies where src is a QPixmap with a mask. If ignoreMask is TRUE, bitBlt ignores the pixmap's mask.

BitBlt has two restrictions:

  1. The src device must be QWidget or QPixmap. You cannot copy pixels from a picture or a printer (external device).
  2. The src device may not have pixel depth greater than dst. You cannot copy from an 8 bit pixmap to a 1 bit pixmap.

Copies a block of pixels from src to dst, perhaps merging each pixel according to the raster operation rop. sx, sy is the top-left pixel in src (0, 0) by default, dx, dy is the top-left position in dst and sw, sh is the size of the copied block (all of src by default).

The most common values for rop are CopyROP and XorROP; the Qt::RasterOp documentation defines all the possible values.

If ignoreMask is FALSE (the default) and src is a masked QPixmap, the entire blit is masked by {src}->mask().

If src, dst, sw or sh is 0, bitBlt() does nothing. If sw or sh is negative bitBlt() copies starting at sx (and respectively, sy) and ending at the right end (respectively, bottom) of src.

src must be a QWidget or QPixmap. You cannot blit from a QPrinter, for example. bitBlt() does nothing if you attempt to blit from an unsupported device.

bitBlt() does nothing if src has a greater depth than dst. If you need to for example, draw a 24-bit pixmap on an 8-bit widget, you must use drawPixmap().

Reimplementado de QPaintDevice.

Q_EXPORT void bitBlt ( QPaintDevice dst,
int  dx,
int  dy,
const QPaintDevice src,
int  sx,
int  sy,
int  sw,
int  sh,
RasterOp  rop,
bool  ignoreMask 
) [friend]

This function copies a block of pixels from one paint device to another (bitBlt means bit block transfer).

  • dst is the paint device to copy to.
  • dx and dy is the position to copy to.
  • src is the paint device to copy from.
  • sx and sy is the position to copy from.
  • sw and sh is the width and height of the block to be copied.
  • rop defines the raster operation to be used when copying.

If sw is 0 or sh is 0, then bitBlt will do nothing.

If sw is negative, then bitBlt calculates sw = src->width - sx. If sh is negative, then bitBlt calculates sh = src->height - sy.

The rop argument can be one of:

  • CopyROP: dst = src.
  • OrROP: dst = src OR dst.
  • XorROP: dst = src XOR dst.
  • NotAndROP: dst = (NOT src) AND dst
  • NotCopyROP: dst = NOT src
  • NotOrROP: dst = (NOT src) OR dst
  • NotXorROP: dst = (NOT src) XOR dst
  • AndROP dst = src AND dst
  • NotROP: dst = NOT dst
  • ClearROP: dst = 0
  • SetROP: dst = 1
  • NopROP: dst = dst
  • AndNotROP: dst = src AND (NOT dst)
  • OrNotROP: dst = src OR (NOT dst)
  • NandROP: dst = NOT (src AND dst)
  • NorROP: dst = NOT (src OR dst)

The ignoreMask argument (default FALSE) applies where src is a QPixmap with a mask. If ignoreMask is TRUE, bitBlt ignores the pixmap's mask.

BitBlt has two restrictions:

  1. The src device must be QWidget or QPixmap. You cannot copy pixels from a picture or a printer (external device).
  2. The src device may not have pixel depth greater than dst. You cannot copy from an 8 bit pixmap to a 1 bit pixmap.

Copies a block of pixels from src to dst, perhaps merging each pixel according to the raster operation rop. sx, sy is the top-left pixel in src (0, 0) by default, dx, dy is the top-left position in dst and sw, sh is the size of the copied block (all of src by default).

The most common values for rop are CopyROP and XorROP; the Qt::RasterOp documentation defines all the possible values.

If ignoreMask is FALSE (the default) and src is a masked QPixmap, the entire blit is masked by {src}->mask().

If src, dst, sw or sh is 0, bitBlt() does nothing. If sw or sh is negative bitBlt() copies starting at sx (and respectively, sy) and ending at the right end (respectively, bottom) of src.

src must be a QWidget or QPixmap. You cannot blit from a QPrinter, for example. bitBlt() does nothing if you attempt to blit from an unsupported device.

bitBlt() does nothing if src has a greater depth than dst. If you need to for example, draw a 24-bit pixmap on an 8-bit widget, you must use drawPixmap().

Reimplementado de QPaintDevice.

Q_EXPORT void bitBlt ( QPaintDevice dst,
int  dx,
int  dy,
const QImage src,
int  sx = 0,
int  sy = 0,
int  sw = -1,
int  sh = -1,
int  conversion_flags = 0 
) [friend]
Q_EXPORT void bitBlt ( QPaintDevice dst,
int  dx,
int  dy,
const QImage src,
int  sx = 0,
int  sy = 0,
int  sw = -1,
int  sh = -1,
int  conversion_flags = 0 
) [friend]
Q_EXPORT void copyBlt ( QPixmap dst,
int  dx,
int  dy,
const QPixmap src,
int  sx,
int  sy,
int  sw,
int  sh 
) [friend]
Q_EXPORT void copyBlt ( QPixmap dst,
int  dx,
int  dy,
const QPixmap src,
int  sx = 0,
int  sy = 0,
int  sw = -1,
int  sh = -1 
) [friend]

Copies a block of pixels from src to dst. The alpha channel and mask data (if any) is also copied from src. NOTE: src is not alpha blended or masked when copied to dst. Use bitBlt() or QPainter::drawPixmap() to perform alpha blending or masked drawing.

sx, sy is the top-left pixel in src (0, 0 by default), dx, dy is the top-left position in dst and sw, is the size of the copied block (all of src by default).

If src, dst, sw or sh is 0 (zero), copyBlt() does nothing. If sw or sh is negative, copyBlt() copies starting at sx (and respectively, sy) and ending at the right edge (and respectively, the bottom edge) of src.

copyBlt() does nothing if src and dst have different depths.

QDataStream & operator<< ( QDataStream s,
const QPixmap pixmap 
) [related]

Writes the pixmap pixmap to the stream s as a PNG image.

Note that writing the stream to a file will not produce a valid image file.

Ver también:
QPixmap::save() Format of the QDataStream operators
QDataStream & operator>> ( QDataStream s,
QPixmap pixmap 
) [related]

Reads a pixmap from the stream s into the pixmap pixmap.

Ver también:
QPixmap::load() Format of the QDataStream operators
QBitmap [friend]
QGLWidget [friend]
QPaintDevice [friend]
QPainter [friend]

Reimplementado de QPaintDevice.


Documentación de los datos miembro


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'