Obsolete Members for QImage
The following members of class QImage are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.
Public Functions
(obsolete) QImage | alphaChannel() const |
(obsolete) int | byteCount() const |
(obsolete) void | setAlphaChannel(const QImage &alphaChannel) |
Member Function Documentation
QImage QImage::alphaChannel() const
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
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.
Warning: This is an expensive function.
See also setAlphaChannel(), hasAlphaChannel(), convertToFormat(), Pixmap, and Image Transformations.
int QImage::byteCount() const
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Returns the number of bytes occupied by the image data.
Note this method should never be called on an image larger than 2 gigabytes. Instead use sizeInBytes().
This function was introduced in Qt 4.6.
See also sizeInBytes(), bytesPerLine(), bits(), and Image Information.
void QImage::setAlphaChannel(const QImage &alphaChannel)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Sets the alpha channel of this image to the given alphaChannel.
If alphaChannel is an 8 bit grayscale image, the intensity values are written into this buffer directly. Otherwise, alphaChannel is converted to 32 bit and the intensity of the RGB pixel values is used.
Note that the image will be converted to the Format_ARGB32_Premultiplied format if the function succeeds.
Use one of the composition modes in QPainter::CompositionMode instead.
Warning: This function is expensive.
See also alphaChannel(), Image Transformations, and Image Formats.