I am new Qt . I tried to draw a line on image using Qpainter on QPixmapBut image did not load just everything was black on Qlabel conataining Qpixmap;
I dont why
my code is
ui->label->resize(pix.size());
pix.
load(QString::fromUtf8("C:\raster.jpg"));
painter.setPen(Red);
painter.drawLine(10,10,50,50);
ui->label->setPixmap(pix);
QPixmap pix(500,500);
ui->label->resize(pix.size());
pix.load(QString::fromUtf8("C:\raster.jpg"));
QPainter painter(&pix);
QPen Red((QColor::QColor(255,0,0)),10);
painter.setPen(Red);
painter.drawLine(10,10,50,50);
ui->label->setPixmap(pix);
To copy to clipboard, switch view to plain text mode
problem is that raster.jpg image is not loading ....only whole black is appearing
Bookmarks