int main(int argc, char **argv)
{
painter
->setRenderHint
(QPainter::TextAntialiasing,
true);
painter->setPen(Qt::black);
painter->setFont(*FontText);
painter
->drawText
(QRect(0,
0,
256,
128), Qt
::TextWordWrap,
"Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt");
painter->setFont(*FontText2);
painter
->drawText
(QRect(0,
128,
256,
128), Qt
::TextWordWrap,
"Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt");
label
->setPixmap
(QPixmap::fromImage(*card
));
label->show();
return a.exec();
}
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QImage* card = new QImage("blank72.png");
QPainter* painter = new QPainter(card);
QFont* FontText = new QFont("Serif", 2, QFont::Normal);
QFont* FontText2 = new QFont("Serif", 10, QFont::Normal);
painter->setRenderHint(QPainter::TextAntialiasing, true);
painter->setPen(Qt::black);
painter->setFont(*FontText);
painter->drawText(QRect(0,0,256,128), Qt::TextWordWrap, "Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt");
painter->setFont(*FontText2);
painter->drawText(QRect(0,128,256,128), Qt::TextWordWrap, "Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt Qt");
QLabel* label = new QLabel(0);
label->setPixmap(QPixmap::fromImage(*card));
label->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks