Issue 20: JPG transparent colour is black.

Filling QImage with transparent white instead of transparent
black. For an artifact free rendering of a transparent web
page into PNG, Format_ARGB32 is needed instead of
Format_ARGB32_Premultiplied.
1.1
Alessandro Portale 2011-01-27 16:54:46 +01:00
parent a8280b1eaf
commit d14be77e56
1 changed files with 2 additions and 2 deletions

View File

@ -253,8 +253,8 @@ bool Phantom::render(const QString &fileName)
if (pageSize.isEmpty())
return false;
QImage buffer(pageSize, QImage::Format_ARGB32_Premultiplied);
buffer.fill(Qt::transparent);
QImage buffer(pageSize, QImage::Format_ARGB32);
buffer.fill(qRgba(255, 255, 255, 0));
QPainter p(&buffer);
p.setRenderHint(QPainter::Antialiasing, true);
p.setRenderHint(QPainter::TextAntialiasing, true);