mirror of https://github.com/vitalif/phantomjs
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
parent
a8280b1eaf
commit
d14be77e56
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue