×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    12

    How to get QImage from camera preview

    Hi ,

    How can I get QImage object in my C++ code from camera preview? I have found somewhere said that I need to use QDeclarativeImageProvider. Can anyone give me some sample code on how to use it? I have been able to get the providerId and imageId from preview's path. But QDeclarativeImageProvider is just an interface and I cannot create object from it. Then how can I call the requestImage method of it?

    Thanks in advance for any suggestions.

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: How to get QImage from camera preview

    Hi,
    could you explain better what is your goal?
    If you have a QML application and you are using QCamera in QML, then you can take the picture, save it in a file and display it in your QML code using Image { source: "/path/to/my/picture"}

  3. #3
    Registered User
    Join Date
    Sep 2011
    Posts
    12

    Re: How to get QImage from camera preview

    Hi Gnuton,

    What I would like to do is to get the camera captured image, then in my c++ code merge the image with another image and save the merged image. That's why I need to get the QImage of the camera captured image. But you are right, I can save the camera captured image in a file and read it from my C++ code.

    Thanks a lot. Another problem is, the camera preview image is always saved as long as I clicked the camera take picture button. Is there any way to not save the preview image into the phone gallery?

  4. #4
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: How to get QImage from camera preview

    when the image is saved you can move it in any directory which is not indexed by tracker.
    If you want to save a temporary file you can use /tmp

  5. #5
    Registered User
    Join Date
    Sep 2011
    Posts
    12

    Re: How to get QImage from camera preview

    Thanks very much gnuton. I have been able to save the image. Now my problem is that when I use qml camera element to capture an image for preview, the image will always be saved and showed in the gallery. Is there anyway that I can delete or not save the preview image?

  6. #6
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: How to get QImage from camera preview

    Check this example : http://doc.trolltech.com/stable/demo...ample-cpp.html

    What about "delete PhotoPreview" to delete preview image.

    regards,
    rahul

Similar Threads

  1. Get QImage from QML Camera element
    By Habolog in forum [Archived] Qt Mobility Project
    Replies: 6
    Last Post: 2011-11-23, 08:44
  2. Get QImage from QML Camera element
    By Habolog in forum Nokia N9
    Replies: 0
    Last Post: 2011-10-03, 09:06
  3. Replies: 2
    Last Post: 2011-05-02, 23:12
  4. N97 camera preview is not smooth
    By kck809 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2010-01-12, 05:59
  5. Camera preview
    By bercobeute in forum Symbian
    Replies: 8
    Last Post: 2005-07-02, 13:19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×