Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Qt] Take picture from USB camera



  • I have a problem with taking a picture from camera. I would like to not save it on disc, I want have it in buffer.
    @
    imageCapture->setCaptureDestination( QCameraImageCapture::CaptureToBuffer);
    imageCapture->capture();
    @

    This pice of code doesn't work.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Doesn't work is a bit vague. You should tell what your are expecting and what you are getting ?



  • The program compiles correctly but the flag has not been assigned to write to buffer. I want save capture in buffer but flag has not been changed.



  • Hi, still very vague. How do you setup your QCameraImageCapture class? Do you set it to:
    @
    camera->setCaptureMode(QCamera::CaptureStillImage);
    camera->start();
    @
    Did you try the entire sequence given in the docs?



  • I set up a webcam and answer correctly and captures the image to a file but when I set the flag to write to the buffer pass code builds correctly without any problems, I checked the setting flags and no change. It may be because it works on windows, linux and to be able to operate correctly.


Log in to reply