PDA

View Full Version : how to update image??



sudhansu
23rd December 2009, 05:34
Hi ALl,
I've an application to show image of your desktop.
I've a methode loadimage(), where i'm creating a label, adding image of yor dektop to lable. In side constructor i'm calling timer , and for each second, the image is updating. Problem is that the updated image is not displaying properly. i did like following


constructor()
{
Label = new QLabel;
Label->setGeometry(this->geometry());
Label->show();
loadimage();
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(updateImage()));
timer->start(1000);
}

loadimage()
{
Label->setPixmap(QPixmap::fromImage(*testImage));//testimage is QImage and initialized
}

updateImnage()
{
//testImage is upading here.
Label->setPixmap(QPixmap::fromImage(*testImage));
Label->show();
}

Can any body tell me how to solve this problem?

wysota
23rd December 2009, 08:37
Define "not properly".