Hello,
I have a widget, that makes a screenshot every second and paints it out:
{
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(1000);
}
painter.
drawPixmap(0,
0,
QPixmap::grabWindow(QApplication::desktop()->winId
()),
0,
0,
100,
100);
}
ZoomWidget::ZoomWidget(QWidget* parent) : QWidget(parent)
{
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(1000);
}
void ZoomWidget::paintEvent(QPaintEvent * /*event*/) {
QPainter painter(this);
painter.drawPixmap(0, 0, QPixmap::grabWindow(QApplication::desktop()->winId()), 0, 0, 100, 100);
}
To copy to clipboard, switch view to plain text mode
it works, but slows down my system quite a lot (every second a small lag)
if i change the interval to 1ms, X has 100% percent processor-load.
how could i speed up this?
(i took a look at kmag - which does basically the same thing in qt3 and is much faster - not really fast either - but still better)
niko
Bookmarks