|
|
Mokrani Abdeslam wrote:
Ok,
While waiting for 4.2 version, I use the code below to reset all the alpha channel each time the value of alpha change.
Thanks.
const uchar *dest_data = img.bits();
int w = img.width(), h = img.height(), bpp = img.bytesPerLine();
for (int y = 0; y < h; ++y) {
QRgb *dest = (QRgb *) dest_data;
for (int x = 0; x < w; ++x) {
*dest = (alpha << 24) | (*dest & 0x00ffffff);
++dest;
}
dest_data += bpp;
}
This won't work if you have an image on the format
QImage::Format_ARGB32_Premultiplied, though... Which is recommended as
it is significantly faster.
-
Gunnar
--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/
|
|