Results 1 to 3 of 3

Thread: When I take a picture with the webcam, I get the previous picture

  1. #1
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default When I take a picture with the webcam, I get the previous picture

    Hello,
    I have modified the Multimedia camera sample to take pictures in an applications, save it as a file and display the picture in a label by loading if from the file.
    The strange thing is that the picture that is displayed in the label is not the picture I have just taken, but the previous capture.
    This is perhaps a classic beginner's mistake, but can you give me any pointers to the litterature or advice?
    i've tried to erase the previous picture before the capture but then I get a message saying the picture does not exist.

    Oh and by the way QPixmap::load() has not worked with BMP files, nor PNG files, but only JPG files.

    My environment is Win 7, Qt 5.2.1 with MingW.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: When I take a picture with the webcam, I get the previous picture

    It is hard to tell without knowing any of the involved code, but

    Quote Originally Posted by feraudyh View Post
    i've tried to erase the previous picture before the capture but then I get a message saying the picture does not exist.
    that could suggest that your problem is the saving code. Maybe saving is done with some kind of asynchronous operation which has not finsihed when you are trying to load.

    Quote Originally Posted by feraudyh View Post
    Oh and by the way QPixmap::load() has not worked with BMP files, nor PNG files, but only JPG files.
    That sounds like the image format plugins for BMP and PNG not being built or not being found at runtime.

    Cheers
    _

  3. #3
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: When I take a picture with the webcam, I get the previous picture

    Well it seems like it's a problem of synchonization. I am using signals and slots to save the picture. Maybe I could be saving it otherwise.

    I'll look into the plugins. I see the plugins/imageformats directory and dont see anything that seems related to png.

    thankyou

Similar Threads

  1. A Way To Set A Picture Without Overriding Last Picture?
    By AMacias in forum Qt Programming
    Replies: 5
    Last Post: 10th December 2012, 13:30
  2. Replies: 3
    Last Post: 9th March 2012, 00:51
  3. How to create PIP (Picture In Picture) on QwebView
    By luckychap in forum Qt Programming
    Replies: 0
    Last Post: 18th July 2011, 13:47
  4. How to add a picture to a Graphicsview
    By Malek in forum Newbie
    Replies: 5
    Last Post: 23rd August 2010, 01:08
  5. can't load picture
    By aoo7wangyan in forum Qt Programming
    Replies: 9
    Last Post: 13th July 2009, 15:59

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.