Unsolved Save picture in bmp format
-
Hello,
I want to save a picture from my camera in a bmp format.
I use a QImageEncoderSettings class to do it but I cannot save in bmp format, I read the docs about this class but I still dont success to use correctly the "setCodec" to have the bmp format.Thanks for your help.
-
Hi and welcome to devnet,
Please show the code you use to save your images.
-
auto filename = QFileDialog::getSaveFileName(this, tr("Save Image"), ".", tr("Image (*.bmp)")); if (filename.isEmpty()) return; mCameraImageCapture->setCaptureDestination(QCameraImageCapture::CaptureToFile); QImageEncoderSettings imageSettings; imageSettings.setCodec("bmp"); imageSettings.setResolution(1024, 1280); mCameraImageCapture->setEncodingSettings(imageSettings); mCamera->setCaptureMode(QCamera::CaptureStillImage); mCamera->start(); mCamera->searchAndLock(); mCameraImageCapture->capture(filename); mCamera->unlock();
The image still save on default(jpg) format with this code.
-
-
I have already tried it and that still save in jpg.
-
@descom_g
hi
Try to list the codec available to be sureforeach(const QString &codecName, imagecapture->supportedImageCodecs()) {
qDebug() << ... -
I am trying to do the same on Windows and not able to set the image format. supportedImageCodecs() returns an empty list. Does anyone know a workaround to set image encoding on Windows?