Hello,
I would like to save my picture (QPixmap) as a png in my label, when I finished to add lines and ellipses.
Like describe in the commentaries:
//---------------------------------------------Class LabelImage
class LabelImage: public QLabel
{
public:
LabelImage()
{
this->setMouseTracking(true);
};
void paintEvent (QPaintEvent *event)
{
QLabel::paintEvent( event );
QPainter painter(this);
// LINES ANS ELLIPSES TREATMENT LOOPS
// BACK UP HERE ! like:
//monPixmap.save("/Users/.../Desktop/GUI Picture/Picture " +
//QString::number(NumberOfPicture) +".png","png",100);
MesureFinished = true;
}
void mousePressEvent (QMouseEvent * event)
{
if (MesureFinished == false)
{
PixelColumn = event->x();
PixelRow = event->y();
this->update();
QLabel::mousePressEvent( event );
}
};
};
↧