How to use QML Camera image in c++ code
How can I access image captured by QML Camera element in c++ code ?
I want to capture an image using qml camera element, change it in some way using c++ and then display it to the user, but I can’t find the way to do this.
Any help appreciated :)
2 replies
Hi,
From what I understand the Camera element will save the image to a file, which you should then be able to manipulate. Maybe something like the following?
- Camera {
- ...
- onImageCaptured : {
- // pass the preview URL to a processImage function exposed from C++
- myApp.processImage(preview)
- }
- }
You’d then need to expose the manipulated image back to QML (either as a URL for a saved file, or using QDeclarativeImageProvider) for display.
If you aren’t real familiar with the ways QML and C++ can communicate with each other, http://doc.qt.nokia.com/latest/qtbinding.html provides a great reference.
Regards,
Michael
You must log in to post a reply. Not a member yet? Register here!



