Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPainter text subpixel antialiasing
Forum Updated to NodeBB v4.3 + New Features

QPainter text subpixel antialiasing

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dmitry89
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved