void appp::paintEvent(QPaintEvent * /* event */){ QPainter painter(this); painter.drawImage(QPoint(0, 0), *theImage);}
void appp::initNewScreenShot(int xx, int yy, int ww, int hh){ theImage = new QImage(ww, hh, QImage::Format_RGB32); theImage->fill(qRgb(0, 0, 0)); QPainter p(theImage); p.drawPixmap(0, 0, ww, hh, QPixmap::grabWindow(QApplication::desktop()->winId(), xx, yy, ww, hh) ); setGeometry(xx, yy, ww, hh);}
QPainter p1( theImage ); p1.setPen(QPen(Qt::black, 3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); p1.setBrush(Qt::yellow); p1.drawPoint(endX,endY); p1.drawPath(path); p1.end(); update();