QPainter text subpixel antialiasing



  • How to draw text with subpixel antialiasing?

    @ QPixmap pixmap(20, 20);
    pixmap.fill(Qt::transparent);
    QPainter painter;
    painter.begin(&pixmap);
    painter.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing);
    painter.drawText(1, 12, "А");
    painter.end();
    pixmap.save("R:/1234.png"); @

    It works with QWidget (and any other Q_OBJECT), but it's too expensive to do widget printscreen. So I need to draw text directly on the image

    http://s52.radikal.ru/i137/1402/02/7c7d37d2cf31.png


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.