Compatibility Members for QPixmap

以下成员源于类 QPixmap are part of the Qt compatibility layer. We advise against using them in new code.

公共类型

enum ColorMode { Auto, Color, Mono }

公共函数

QPixmap (const QString & fileName , const char * format , ColorMode mode )
QPixmap (const QImage & image )
bool convertFromImage (const QImage & image , ColorMode mode )
QImage convertToImage () const
bool load (const QString & fileName , const char * format , ColorMode mode )
bool loadFromData (const uchar * buf , uint len , const char * format , ColorMode mode )
void resize (int width , int height )
void resize (const QSize & size )
bool selfMask () const
QPixmap xForm (const QMatrix & matrix ) const
operator QImage () const
QPixmap & operator= (const QImage & image )

成员类型文档编制

enum QPixmap:: ColorMode

This enum type defines the color modes that exist for converting QImage 对象到 QPixmap . It is provided here for compatibility with earlier versions of Qt.

使用 Qt::ImageConversionFlags 代替。

常量 描述
QPixmap::Auto 0 选择 Color or Mono on a case-by-case basis.
QPixmap::Color 1 Always create colored pixmaps.
QPixmap::Mono 2 Always create bitmaps.

成员函数文档编制

QPixmap:: QPixmap (const QString & fileName , const char * format , ColorMode mode )

Use the constructor that takes a Qt::ImageConversionFlag 代替。

QPixmap:: QPixmap (const QImage & image )

Constructs a pixmap from the QImage image .

Use the static fromImage () 函数代替。

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

Use the static fromImage () 函数代替。

QImage QPixmap:: convertToImage () const

使用 toImage () 函数代替。

bool QPixmap:: load (const QString & fileName , const char * format , ColorMode mode )

使用 load () 函数接受 Qt::ImageConversionFlag 代替。

bool QPixmap:: loadFromData (const uchar * buf , uint len , const char * format , ColorMode mode )

使用 loadFromData () 函数接受 Qt::ImageConversionFlag 代替。

void QPixmap:: resize ( int width , int height )

使用 QPixmap::copy () instead to get the pixmap with the new size.

例如,若有代码像

pixmap.resize(10, 20);
					

可以把它重写成

pixmap = pixmap.copy(0, 0, 10, 20);
					

void QPixmap:: resize (const QSize & size )

这是重载函数。

使用 QPixmap::copy () instead to get the pixmap with the new size.

例如,若有代码像

pixmap.resize(size);
					

可以把它重写成

pixmap = pixmap.copy(QRect(QPoint(0, 0), size));
					

bool QPixmap:: selfMask () const

Returns whether the pixmap is its own mask or not.

This function is no longer relevant since the concept of self masking doesn't exists anymore.

QPixmap QPixmap:: xForm (const QMatrix & matrix ) const

使用 transformed () 代替。

QPixmap:: operator QImage () const

将像素图返回为 QImage .

使用 toImage () 函数代替。

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

这是重载函数。

转换给定 image to a pixmap that is assigned to this pixmap.

Use the static fromImage () 函数代替。