Obsolete Members for QImage

以下成員源於類 QImage 已過時。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

公共函數

(obsolete) QImage alphaChannel () const
(obsolete) int byteCount () const
(obsolete) int numBytes () const
(obsolete) int numColors () const
(obsolete) int serialNumber () const
(obsolete) void setNumColors (int n )
(obsolete) void setText (const char * key , const char * 語言 , const QString & text )
(obsolete) QString text (const char * key , const char * 語言 = nullptr) const
(obsolete) QString text (const QImageTextKeyLang & keywordAndLanguage ) const
(obsolete) QStringList textLanguages () const
(obsolete) QList<QImageTextKeyLang> textList () const
(obsolete) QImage transformed (const QMatrix & matrix , Qt::TransformationMode mode = Qt::FastTransformation) const

靜態公共成員

(obsolete) QMatrix trueMatrix (const QMatrix & matrix , int width , int height )

成員函數文檔編製

QImage QImage:: alphaChannel () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the alpha channel of the image as a new grayscale QImage in which each pixel's red, green, and blue values are given the alpha value of the original image. The color depth of the returned image is 8-bit.

You can see an example of use of this function in QPixmap 's alphaChannel() , which works in the same way as this function on QPixmaps.

Most usecases for this function can be replaced with QPainter and using composition modes.

Note this returns a color-indexed image if you want the alpha channel in the alpha8 format instead use convertToFormat ( Format_Alpha8 ) on the source image.

警告: This is an expensive function.

另請參閱 setAlphaChannel (), hasAlphaChannel (), convertToFormat (), Pixmap ,和 圖像變換 .

int QImage:: byteCount () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

返迴由圖像數據占據的字節數。

Note this method should never be called on an image larger than 2 gigabytes. Instead use sizeInBytes ().

該函數在 Qt 4.6 引入。

另請參閱 sizeInBytes (), bytesPerLine (), bits (),和 圖像信息 .

int QImage:: numBytes () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

返迴由圖像數據占據的字節數。

另請參閱 sizeInBytes ().

int QImage:: numColors () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

返迴圖像的顔色錶大小。

另請參閱 setNumColors () 和 setColorCount ().

int QImage:: serialNumber () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

返迴內容標識數對於此 QImage 對象。截然不同的 QImage objects can only have the same serial number if they refer to the same contents (but they don't have to).

使用 cacheKey () 代替。

警告: The serial number doesn't necessarily change when the image is altered. This means that it may be dangerous to use it as a cache key.

另請參閱 operator== ().

void QImage:: setNumColors ( int n )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

重置顔色錶大小以包含 n 條目。

另請參閱 numColors () 和 setColorCount ().

void QImage:: setText (const char * key , const char * 語言 , const QString & text )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

將圖像文本設為給定 text 並將其關聯到給定 key . The text is recorded in the specified 語言 , or in a default language if 語言 is nullptr .

Use setText() instead.

The language the text is recorded in is no longer relevant since the text is always set using QString and UTF-8 representation.

QString QImage:: text (const char * key , const char * 語言 = nullptr) const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the text recorded for the given key 以給定 語言 , or in a default language if 語言 is nullptr .

Use text() instead.

The language the text is recorded in is no longer relevant since the text is always set using QString and UTF-8 representation.

QString QImage:: text (const QImageTextKeyLang & keywordAndLanguage ) const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

這是重載函數。

Returns the text recorded for the given keywordAndLanguage .

Use text() instead.

The language the text is recorded in is no longer relevant since the text is always set using QString and UTF-8 representation.

QStringList QImage:: textLanguages () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the language identifiers for which some texts are recorded. Note that if you want to iterate over the list, you should iterate over a copy.

The language the text is recorded in is no longer relevant since the text is always set using QString and UTF-8 representation.

另請參閱 textKeys ().

QList < QImageTextKeyLang > QImage:: textList () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns a list of QImageTextKeyLang objects that enumerate all the texts key/language pairs set for this image.

The language the text is recorded in is no longer relevant since the text is always set using QString and UTF-8 representation.

另請參閱 textKeys ().

QImage QImage:: transformed (const QMatrix & matrix , Qt::TransformationMode mode = Qt::FastTransformation) const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Use transformed(const QTransform &matrix, Qt::TransformationMode mode) instead.

返迴圖像副本的變換是使用給定變換 matrix 和變換 mode .

返迴圖像通常擁有如原始圖像的相同 {圖像格式}{格式}。不管怎樣,復雜變換可能産生原始圖像變換像素並不會覆蓋其所有像素的圖像。在這種情況下,會將透明顔色值賦值給這些背景像素,且會賦予變換圖像帶有 Alpha 通道的格式,即使原始圖像沒有。

變換 matrix 在內部調節以補償不想要的平移;即,産生圖像是包含原始圖像所有變換點的最小圖像。使用 trueMatrix () 函數檢索用於變換圖像的實際矩陣。

另請參閱 trueMatrix () 和 圖像變換 .

[static] QMatrix QImage:: trueMatrix (const QMatrix & matrix , int width , int height )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Use trueMatrix(const QTransform &matrix, int w, int h) instead.

返迴用於變換圖像的實際矩陣采用給定 width , height and matrix .

當變換圖像使用 transformed () 函數,變換矩陣在內部調節以補償不想要的平移,即 transformed () 返迴包含原始圖像中所有變換點的最小圖像。此函數返迴修改矩陣,將來自原始圖像中的點正確地映射到新圖像。

另請參閱 transformed () 和 圖像變換 .