kaml.mish
20th January 2015, 10:00
Hello All
I am facing issue on drawText over a QPixmap. The error that gets displayed
QPainter::begin: Paint device returned engine == 0, type: 2 (painting/qpainter.cpp:1734, bool QPainter::begin(QPaintDevice*))
QPainter::setFont: Painter not active (painting/qpainter.cpp:4068, void QPainter::setFont(const QFont&))"
The code is given below
QImage originalImg = QImage(frame->data[0],1280,700,frame->linesize[0],QImage::Format_RGB888).copy();
qDebug()<<originalImg.size();
pxmap.fromImage(originalImg);
QPainter paint(&pxmap);
paint.setFont(QFont("Arial"));
paint.drawText(QPoint(200,200),"Test");
I am facing issue on drawText over a QPixmap. The error that gets displayed
QPainter::begin: Paint device returned engine == 0, type: 2 (painting/qpainter.cpp:1734, bool QPainter::begin(QPaintDevice*))
QPainter::setFont: Painter not active (painting/qpainter.cpp:4068, void QPainter::setFont(const QFont&))"
The code is given below
QImage originalImg = QImage(frame->data[0],1280,700,frame->linesize[0],QImage::Format_RGB888).copy();
qDebug()<<originalImg.size();
pxmap.fromImage(originalImg);
QPainter paint(&pxmap);
paint.setFont(QFont("Arial"));
paint.drawText(QPoint(200,200),"Test");