Results 1 to 2 of 2

Thread: how to update image??

  1. #1
    Join Date
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default how to update image??

    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

    Qt Code:
    1. constructor()
    2. {
    3. Label = new QLabel;
    4. Label->setGeometry(this->geometry());
    5. Label->show();
    6. loadimage();
    7. QTimer *timer = new QTimer(this);
    8. connect(timer, SIGNAL(timeout()), this, SLOT(updateImage()));
    9. timer->start(1000);
    10. }
    11.  
    12. loadimage()
    13. {
    14. Label->setPixmap(QPixmap::fromImage(*testImage));//testimage is QImage and initialized
    15. }
    16.  
    17. updateImnage()
    18. {
    19. //testImage is upading here.
    20. Label->setPixmap(QPixmap::fromImage(*testImage));
    21. Label->show();
    22. }
    To copy to clipboard, switch view to plain text mode 

    Can any body tell me how to solve this problem?
    Last edited by wysota; 23rd December 2009 at 08:37. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to update image??

    Define "not properly".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Image Commander v.1.2
    By piotrek in forum Qt-based Software
    Replies: 0
    Last Post: 20th April 2009, 10:59
  2. Qt Update project - Opinions wanted
    By pvdk in forum Qt Programming
    Replies: 0
    Last Post: 8th November 2008, 08:41
  3. can Qlabel display a series of image one by one ?
    By jirach_gag in forum Qt Tools
    Replies: 3
    Last Post: 11th August 2008, 15:36
  4. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 02:10
  5. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.