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. -
@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 ? -
@mrjj said in Draw basic Axes on QPixmap ?:
Hi
Well it sounds to me like the image is live ?
Like a camera feed ?Yes. Pretty much.
-
@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));
-
@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));
Hi, with this approach I will have to first create the axis externally and save them as some sort of a transparent image ?
-
@r-p-h use only .png images
-
This post is deleted!
-
@pl45m4 said in Draw basic Axes on QPixmap ?:
A ChartView, but as you already said, you have to create it on runtime, because it`s not a Widget in Qt Designer.
@jhoney
I think @R-P-H doen't need the exact same answer again :) -
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...
29/29