以下成員源於類 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 ) |
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. |
Use the constructor that takes a Qt::ImageConversionFlag 代替。
Constructs a pixmap from the QImage image .
使用靜態 fromImage () 函數代替。
使用靜態 fromImage () 函數代替。
使用 toImage () 函數代替。
使用 load () 函數接受 Qt::ImageConversionFlag 代替。
使用 loadFromData () 函數接受 Qt::ImageConversionFlag 代替。
使用 QPixmap::copy () instead to get the pixmap with the new size.
例如,若有代碼像
pixmap.resize(10, 20);
可以把它重寫成
pixmap = pixmap.copy(0, 0, 10, 20);
這是重載函數。
使用 QPixmap::copy () instead to get the pixmap with the new size.
例如,若有代碼像
pixmap.resize(size);
可以把它重寫成
pixmap = pixmap.copy(QRect(QPoint(0, 0), size));
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.
使用 transformed () 代替。
將像素圖返迴為 QImage .
使用 toImage () 函數代替。
這是重載函數。
轉換給定 image to a pixmap that is assigned to this pixmap.
使用靜態 fromImage () 函數代替。