I want to crop a selected a rectangle area in live video feed and save those area or image in my local drive
Unsolved
General and Desktop
-
@robotsandi
Is that correct
mCameraImageCapture->setCaptureDestination(QCameraImageCapture::CaptureToBuffer);
to mCameraImage Capture is store image in buffer?? -
@robotsandi
QPixmap original("mCameraImageCapture");
QPixmap cropped = original.copy(x1, y1, width, height);
cropped.save(filename);
is pic is not save -
Yes it think its ok.
But not used in sample so might not be needed.
They just setup
imageCapture = new QCameraImageCapture(camera);
and hook up signal
connect(imageCapture, &QCameraImageCapture::imageCaptured, this, &Camera::processCapturedImage);
and then dovoid Camera::processCapturedImage(int requestId, const QImage& img) { Q_UNUSED(requestId); QImage scaledImage = img.scaled(ui->viewfinder->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); ui->lastImagePreviewLabel->setPixmap(QPixmap::fromImage(scaledImage)); // Display captured image for 4 seconds. displayCapturedImage(); QTimer::singleShot(4000, this, &Camera::displayViewfinder); }