Set Digital zoom in Camera



  • How do i set Digital zoom in camera on pinchFinished?
    @PinchArea {
    id: pincharea
    anchors.fill: parent
    pinch.target: (flipable.flipped == false) ? frontImage : viewfinderBack
    pinch.minimumScale: 0.5
    pinch.maximumScale: 10

        onPinchFinished: {
            if(cameraPage.isCamera == true){
                 cameraBack.setDigitalZoom(*pincharea.scale*)
            }
        }
    }@
    

    what values should be passed as argument to setDigitalZoom ? the above parameter doesnt zoom it exactly

    Thanks in Advance


  • Moderators

    Hi,

    Try
    @
    if(cameraPage.isCamera == true){
    cameraBack.digitalZoom = pincharea.scale
    }
    @



  • no dude...that doesnt work out..:-(

    Thanks



  • Hi
    I could solve it bt nt completely...
    here is the code..
    @if(cameraPage.isCamera == true){
    cameraBack.digitalZoom = pincharea.scale
    }@

    Thanks


  • Moderators

    That is what i said earlier ;)
    Anyway, any changes you did other than that to get it working ? Just for info so that others may find it useful.



  • hey i am sorry...i had put wrong code...digitalZoom is read only property..

    @ if(cameraPage.isCamera == true){
    cameraBack.setDigitalZoom = pinch.scale
    }
    @
    This doesnt complete my problem...as pinch.scale only holds the distance b/w two points.Everytime i start pinch ,pinch.scale becomes default to 1.0..so i have to add

    @cameraBack.setDigitalZoom=pinch.scale-1.0 +
    pinch .previousScale
    @

    I am working on it still...

    Thanks :-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.