Draw basic Axes on QPixmap ?
-
@mrjj said in Draw basic Axes on QPixmap ?:
@r-p-h
oh, well for that sort of overlay,
you will need to draw the axis
anytime the image changes regardlessly.Hi, Surely I could just draw (or plot ?) the axes once in the beginning and then just display or draw the image inside the plot. I think that re-drawing the axes every time will be very inefficient. Also manually drawing the tick marks and values seems like it could become tedious, so maybe using some form of QChart is the way to go...
-
Hi
Well it sounds to me like the image is live ?
Like a camera feed ? -
@r-p-h
QLabel *Label_backImg = new QLabel(this);
Label_backImg->setMinimumSize(80,80);
Label_backImg->setMaximumSize(80,80);
Label_backImg->setPixmap(QPixmap(":/images/edit-icon.png").scaled (Label_backImg->width(),Label_backImg->height(),Qt::KeepAspectRatio));QLabel *labelIcon = new QLabel(Label_backImg); labelIcon->setGeometry(40,8,40,40); labelIcon->setPixmap(QPixmap(":/images/notification.png").scaled (labelIcon->width(),labelIcon->height(),Qt::KeepAspectRatio));
result image is :
-
@anil_arise said in Draw basic Axes on QPixmap ?:
@r-p-h
QLabel *Label_backImg = new QLabel(this);
Label_backImg->setMinimumSize(80,80);
Label_backImg->setMaximumSize(80,80);
Label_backImg->setPixmap(QPixmap(":/images/edit-icon.png").scaled (Label_backImg->width(),Label_backImg->height(),Qt::KeepAspectRatio));QLabel *labelIcon = new QLabel(Label_backImg); labelIcon->setGeometry(40,8,40,40); labelIcon->setPixmap(QPixmap(":/images/notification.png").scaled (labelIcon->width(),labelIcon->height(),Qt::KeepAspectRatio));
result image is :
Hi, with this approach I will have to first create the axis externally and save them as some sort of a transparent image ?
-
Thanks for the support guys. I tried making a transparent QPixmap image using Qt::transparent fill for the axis and overlaying it onto my other QPixmap, however it didn't work properly. So I ended up just drawing directly onto the image itself. Not the most efficient method but it seems to work...