Saving the image works.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 21 Jun 2017 21:33:47 +0000 (23:33 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 21 Jun 2017 21:33:47 +0000 (23:33 +0200)
qtapp/barcode2cash/mainwindow.cpp

index 42d69fcce3f0818bd748ecb367f5deb10a35eb1b..b7f00c25a6ad5895cb01a87628887d23e45af7e2 100644 (file)
@@ -26,6 +26,7 @@ MainWindow::MainWindow(QWidget *parent) :
         connect(imageCapture, SIGNAL(readyForCaptureChanged(bool)), SLOT(updateCameraInfo()));
         updateCameraInfo();
         connect(ui->pbCapture, SIGNAL(clicked()), SLOT(capture()));
+        camera->start();
     }
 
 
@@ -47,8 +48,10 @@ void MainWindow::updateCameraInfo() {
 
 
 void MainWindow::capture() {
-    camera->start();
+    QImageEncoderSettings imageSettings;
+    imageSettings.setCodec("image/jpeg");
+    imageCapture->setEncodingSettings(imageSettings);
     camera->searchAndLock();
-    imageCapture->capture("test.png");
+    imageCapture->capture("test.jpg");
     camera->unlock();
 }