-
Bug
-
Resolution: Cannot Reproduce
-
Not Evaluated
-
4.7.0
-
None
-
X11, RHEL4.6,
The following code:
pixmap.setMask(pixmap.createMaskFromColor(QColor(255,0,255))); QPixmap scaled_pixmap = pixmap.scaled(scaled_width, scaled_height, Qt::KeepAspectRatio, Qt::SmoothTransformation);
worked correctly in Qt 4.6 to generate a scaled pixmap with the mask in tact. In 4.7, the resulting bitmap has no transparency when used.
The problem also occurs when using QIcon with a QPixmap with a mask.
The following work-around works OK to generate a scaled, transparent pixmap:
QBitmap mask = pixmap.createMaskFromColor(QColor(255,0,255)); pixmap.setMask(mask); QPixmap transparent_pixmap(pixmap.size()); transparent_pixmap.fill(QColor(255, 255, 255, 0)); QPainter painter(&transparent_pixmap); painter.drawPixmap(0, 0, pixmap); painter.end(); QPixmap scaled_pixmap = transparent_pixmap.scaled(scaled_width, scaled_height, Qt::KeepAspectRatio, Qt::SmoothTransformation);