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. Capture image without saving

Capture image without saving

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
10 Posts 7 Posters 4.4k 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.
  • Taz742T Offline
    Taz742T Offline
    Taz742
    wrote on last edited by Taz742
    #1

    how capture and preview image without saving QML camera? is it posible?

    Do what you want.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You have an example of that in the detailed description of the Camera type.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Taz742T 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        You have an example of that in the detailed description of the Camera type.

        Taz742T Offline
        Taz742T Offline
        Taz742
        wrote on last edited by Taz742
        #3

        @SGaist
        Hi.
        i have already seen this post. Can you give me some code please :)
        i know how to capture image, but it saves automaticaly but i dont want save image

        Do what you want.

        1 Reply Last reply
        0
        • 6thC6 Offline
          6thC6 Offline
          6thC
          wrote on last edited by
          #4

          There is an example application "QML Camera Example" that has code. Works with my webcam on win10, qt5.8

          Taz742T 1 Reply Last reply
          0
          • 6thC6 6thC

            There is an example application "QML Camera Example" that has code. Works with my webcam on win10, qt5.8

            Taz742T Offline
            Taz742T Offline
            Taz742
            wrote on last edited by
            #5

            @6thC
            listen bro, i think that you dont realize what i want... when i write code like this ==> camera.imagecapture.captured(), it saves capture and i dont want save. do you understand?

            Do what you want.

            J.HilkJ 1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              From a quick look at the Camera element and related sources, it seems that it's currently not possible.

              As a work around, you could set the location to a temporary place that you'll nuke whenever you want/need to.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Schluchti
                wrote on last edited by
                #7

                @Taz742 Jep, @SGaist suggested solutions seems to be the only one that's possible at the moment. I did basically the same in my application. After the image is written to disk, I am deleting the image again. If you are not using the Camera very heavily this approach should be fine. If however you are constantly taking a picture, this approach can really stress out your data storage (flash, sd card). During my research of the problem, I also found another approach that's based on QVideoProbe, but unfortunately this doesn't work on all platforms. See: http://lists.qt-project.org/pipermail/interest/2014-February/011125.html

                Want to read more about Qt?

                https://gympulsr.com/blog/qt/

                Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

                GrecKoG 1 Reply Last reply
                0
                • Taz742T Taz742

                  @6thC
                  listen bro, i think that you dont realize what i want... when i write code like this ==> camera.imagecapture.captured(), it saves capture and i dont want save. do you understand?

                  J.HilkJ Offline
                  J.HilkJ Offline
                  J.Hilk
                  Moderators
                  wrote on last edited by
                  #8

                  @Taz742

                  Any reason you don't fall back on the c++ version of QCamera?

                  Previously the c++ version did only run on Win without problems. But I was pleasant surpriesed, when I tested the Camera-example with QT5.8 on IOS and everything worked without problem.


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  1 Reply Last reply
                  0
                  • S Schluchti

                    @Taz742 Jep, @SGaist suggested solutions seems to be the only one that's possible at the moment. I did basically the same in my application. After the image is written to disk, I am deleting the image again. If you are not using the Camera very heavily this approach should be fine. If however you are constantly taking a picture, this approach can really stress out your data storage (flash, sd card). During my research of the problem, I also found another approach that's based on QVideoProbe, but unfortunately this doesn't work on all platforms. See: http://lists.qt-project.org/pipermail/interest/2014-February/011125.html

                    GrecKoG Offline
                    GrecKoG Offline
                    GrecKo
                    Qt Champions 2018
                    wrote on last edited by
                    #9

                    @Schluchti It's possible to use QAbstractVideoFilter, more info here : http://blog.qt.io/blog/2015/03/20/introducing-video-filters-in-qt-multimedia/

                    @Taz742 What platform do you target ?
                    AFAIK it's possible to implement a QCameraImageCapture with setCaptureDestination(CaptureToBuffer) and replace the default one from Camera, but CaptureToBuffer is not supported on iOS : https://bugreports.qt.io/browse/QTBUG-46280?filter=14826

                    1 Reply Last reply
                    1
                    • LorenzL Offline
                      LorenzL Offline
                      Lorenz
                      wrote on last edited by
                      #10

                      You could also have a look at the NativeUtils Camera Picker that comes with V-Play. It allows you to take a picture from QML with just a few lines of QML code. The picture is not saved by default, it's just a temporary file which is deleted automatically when the app is closed.

                      This works an Android and iOS.

                      Have a look at this code sample:

                          AppButton {
                            text: "Take Picture!"
                            onClicked: nativeUtils.displayCameraPicker()
                          }
                      
                          Connections {
                            target: nativeUtils
                            
                            onCameraPickerFinished: {
                              testImage.source = path
                            }
                          }
                      
                          Image {
                            id: testImage
                            // we will display the image here
                          }
                      

                      Developer @ V-Play Engine - http://v-play.net/qt

                      V-Play simplifies

                      • Game Development with Qt
                      • Mobile App Dev with Qt esp. iOS & Android

                      What others say
                      V-Play scored #1 in Cross-Platform App Development Tools Report - see why: https://goo.gl/rgp3rq

                      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