QSvgRenderer onto QImage with antialiasing
Hi,
I have a QImage and I draw an svg image onto. Here is my simplified code:
Code:
void WP
::DrawImage(QImage &mImage
) {
QRect rct
(0,
0,
500,
500);
svgImg->render(pPainter, rct);
pPainter
->setRenderHints
(QPainter::Antialiasing,
true);
pPainter->end();
delete svgImg;
delete pPainter;
}
However, the painted image is aliased and I want to have an anti-aliased image. I have tried setRenderHints() but didn’t help. Could anyone help me about how to implement it?
Re: QSvgRenderer onto QImage with antialiasing
I would start by rendering the SVG after you set the Antialiasing hint.
BTW: neither the QPainter nor the QSvgRenderer needs to allocated on the heap.
Re: QSvgRenderer onto QImage with antialiasing
Quote:
Originally Posted by
ChrisW67
I would start by rendering the SVG after you set the Antialiasing hint.
BTW: neither the QPainter nor the QSvgRenderer needs to allocated on the heap.
I have already tried it but no joy.
I have found another thread in this forum http://www.qtcentre.org/threads/2327...r-antialiasing
However, I didn't get what he meant. I did try painting onto QPixmap but the image is still aliased.
Any help?