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 .

使用靜態 fromImage () 函數代替。

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

使用靜態 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.

使用靜態 fromImage () 函數代替。