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. Pinch and zoom for camera using Qml
Forum Updated to NodeBB v4.3 + New Features

Pinch and zoom for camera using Qml

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.0k 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.
  • B Offline
    B Offline
    beemaneni
    wrote on last edited by
    #1

    Hi Guys,

    I am posting my previous question again as i did not get appropriate output with that.
    Here is my requirement.
    1.Start Camera and set capture mode as captureStillImage
    2.I need to set the zoom for camera by pinch and zoom.

    I have tried in various methods but could not get proper output as it works partially.I hope i am having problem with the logic only..
    Here is my code:
    @Camera {
    id: cameraObj
    captureMode: Camera.CaptureStillImage
    }
    VideoOutput {
    id: viewfinderBack
    source: cameraObj
    anchors.fill: parent
    visible: true
    autoOrientation: true
    }
    PinchArea {
    id: pincharea
    anchors.fill: parent
    pinch.target: viewfinderBack
    scale: root.defScale // 0 by default
    pinch.minimumScale: 0.5
    pinch.maximumScale: 4.0

        property  real zoomValue: 0
        property double oldZoom: 0
    
        onPinchStarted: {
            oldZoom = pincharea.scale
        }
        onPinchUpdated: {
            if(zoomValue < 4.0) {
                zoomValue = oldZoom + pinch.scale
            }
        }
        onPinchFinished: {
            zoomValue = oldZoom + pinch.scale
            if(zoomValue < 4.0) {
                pincharea.scale = zoomValue
                cameraObj.setDigitalZoom(zoomValue)
            }
        }
    }@
    

    The above code does not exactly sink between pinch area scaled and zoomed. Here up on every pinch start the value goes to default.so i added the previous scale to that.

    Please help me with the solution.Its hardtime for me as i am struggling to get this for longtime.

    Thanks in Advance

    Regards
    Bala Beemaneni

    Bala B
    Infinite Computer systems
    Chennai

    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