QCameraImageCapture save image to file
Unsolved
General and Desktop
-
Hi
I use QCameraImageCaptureMainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ... cameraImageCapture = new QCameraImageCapture(camera); cameraImageCapture->setCaptureDestination(QCameraImageCapture::CaptureToBuffer); connect(cameraImageCapture,SIGNAL(imageCaptured(int,QImage)),this,SLOT(imageCapture(int,QImage))); } void MainWindow::on_buttonTakePhoto_clicked() { camera->start(); camera->searchAndLock(); cameraImageCapture->capture(); camera->unlock(); camera->stop(); }
This code save image to file, even though it is set differently.
Where is problem?
-
Hi and welcome to devnet,
What is your problem in the first place ? The code looks it's working.
-
What version of Qt ? On what OS ? How did you diagnose that ?
-
@Ratzz
I set only CaptureToBuffercameraImageCapture->setCaptureDestination(QCameraImageCapture::CaptureToBuffer); qDebug() << cameraImageCapture->captureDestination();
Output is :
QFlags(0x2)
In doc 0x2 is a value of QCameraImageCapture::CaptureToBuffer.
-
Did you check that the capture destination was supported ? You can do that using isCaptureDestinationSupported.