Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to use QML Camera image in c++ code
Forum Updated to NodeBB v4.3 + New Features

How to use QML Camera image in c++ code

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 4 Posters 4.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lyman
    wrote on last edited by
    #1

    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 :)

    1 Reply Last reply
    0
    • T Offline
      T Offline
      thisisbhaskar
      wrote on last edited by
      #2

      This should be possible. After you take a picture, call a method in C++ ( expose a method or class instance from C++). Once you are done with your C++ code, raise a signal and catch it inside QML. I don't see whey this should not be possible?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbrasser
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lygstate
          wrote on last edited by
          #4

          I want to process every frame of the camera video, how to do that @mbrasser.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved