PDA

View Full Version : Set image for qml camera from c++



neda
6th March 2016, 08:00
Hi,
I convert image of camera to base64 string.


QFile fileImg(url of image); // == camera.imageCapture.capturedImagePath
fileImg.open(QIODevice::ReadOnly);
QByteArray imageData = fileImg.readAll();
QByteArray imageData_Base64 = imageData.toBase64();
xmlWriter.writeAttribute("image",imageData_Base64);

I have a string like this:
/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAA ......

Now I want show above string as image in qml camera.

Please guide me.

anda_skoa
6th March 2016, 10:05
If you want to display a string, the primary element of choice would be Text.

No idea what you mean "in qml camera" though, a Camera element is for showing the data from a camera.
If you want the text to be on top of the camera image, you can likely use the Text as a child of the Camera.

Cheers,
_