Save Image in XML file
I want to get image from camera and save to XML file.
I pass "photoPreview.source (== image://camera/preview_1)" as URL of captured image to c++ class.
I have this error:
How can I get URL of captured image by camera? (URL of photoPreview.source)
QFile fileImg(url_image); // == > photoPreview.source (== image://camera/preview_1) fileImg.open(QIODevice::ReadOnly); QByteArray imageData = fileImg.readAll(); QByteArray imageData_Base64 = imageData.toBase64(); xmlWriter.writeAttribute("image",imageData_Base64);
You need to use the capturedImagePath in order to get the file corresponding to your captured image.