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. After the photographing to continue the preview

After the photographing to continue the preview

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 232 Views
  • 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.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on last edited by Mikeeeeee
    #1

    Hi!
    After the photographing to continue the preview?
    In this case, the place of preview somehow gets a picture from the photo.

    import QtQuick 2.12
    import QtQuick.Controls 2.12
    import QtMultimedia 5.12
    
    Item {
        width: 400
        height: 700
    
        property alias buttonPhoto: buttonPhoto
        property alias photoImage: photoImage
        property alias photoPreview: photoPreview
        property alias camera: camera
    
        Camera {
            id: camera
    
            imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash
    
            exposure {
                exposureCompensation: -1.0
                exposureMode: Camera.ExposurePortrait
            }
    
            flash.mode: Camera.FlashRedEyeReduction
    
            imageCapture {
                id: imageCapture1
                onImageCaptured: {
                    photoPreview.source = preview  // Show the preview in an Image
                }
                onImageSaved: {
                    //photoImage.source = "file:" + appCore.getDirApp() +  "/IMG_00000001.jpg"
                    photoImage.source = appCore.getImage(appCore.getDirApp() +  "/IMG_00000001.jpg")
                    //imageCapture1.cancelCapture()
                }
            }
        }
    
        VideoOutput {
            anchors.bottomMargin: 331
            source: camera
            anchors.fill: parent
            focus : visible // to receive focus and capture key events when visible
            autoOrientation: true
        }
    
        Image {
            id: photoPreview
        }
    
        Image {
            id: photoImage
            x: 21
            y: 433
            width: 219
            height: 215
            fillMode: Image.PreserveAspectFit
            cache: false
            source: "qrc:/Images/Images/6.png"
    
        }
    
        Button {
            id: buttonPhoto
            x: 264
            y: 507
            text: qsTr("Photo")
    //        onClicked: {
    //            camera.imageCapture.captureToLocation(appCore.getDirApp() +  "/IMG_00000001.jpg")
    //        }
        }
    }
    
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      Mikeeeeee
      wrote on last edited by
      #2

      Everything worked. It is only in Preview photo display of a static image, removed the photo Preview and all is well.

      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