Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Rendering svg image onto QImage



  • Hi,

    I have a QImage and I draw an svg image onto. Here is my simplified code:

    @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->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?


Log in to reply