以下成员源于类 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 .
Use the static fromImage () 函数代替。
Use the static 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.
Use the static fromImage () 函数代替。