Hi,
I have a QImage and I draw an svg image onto. Here is my simplified 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;
}
void WP::DrawImage(QImage &mImage)
{
QPainter *pPainter = new QPainter(&mImage);
QSvgRenderer *svgImg = new QSvgRenderer(linkToSvgImage);
QRect rct(0, 0, 500, 500);
svgImg->render(pPainter, rct);
pPainter->setRenderHints(QPainter::Antialiasing, true);
pPainter->end();
delete svgImg;
delete pPainter;
}
To copy to clipboard, switch view to plain text mode
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?
Bookmarks