I'm having what is follow:
QLabel* label_PM= new QLabel(this);
QPixmap PM ("C:/PM.jpg");
label_PM->setPixmap(PM);
I would like to insert to the PM a text like what is done in OpenCV cv::putText.
Nothing from research seems to resolve my problem,
Is there a way to do so?
Drawing to a QPixmap
is done through a QPainter
. For example:
QPixmap pix = ...;
QPainter painter( &pix );
painter.setFont( QFont("Arial") );
painter.drawText( QPoint(100, 100), "Hello" );
This is a very basic usage, look at the QPainter
documentation for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With