-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.7.0
-
None
-
Mac OS X 10.6.4, Windows 7
If you fill an ARGB32 image with, say, 0x00ff0000, and draw text into it, you will see that the antialiasing pixels on the edges of the glyphs are tinted red. The same is visible if you draw into a black, transparent buffer and then draw this on top of e.g. a blue background.
This means that a transparent ARGB32 image cannot be used to cache text, since the text will look out of place unless the transparent background has the same color as the destination pixels.
The same problem is not visible with ARGB32_Premultiplied, or with a QPixmap (on raster or elsewhere.)
Put the following into a widget's paint event to see:
QImage image(400, 50, QImage::Format_ARGB32_Premultiplied ); image.fill(0x00ff0000); { QPainter p(&image); p.setFont(font); p.setPen(QColor("white")); p.drawText(0, 30, "FOOBAR (argb32)"); } QPainter p(this); p.fillRect(rect(), Qt::blue); p.drawImage(0, 0, image);
The effect is especially visible on Mac OS X, but can be seen on Windows as well.