PinchArea scale in and scale out touch coordinates
-
hi p3c0
Thanks for ur interest and i have seen that.that works well for pinch and zoom of an image ,bt further ater pinch and scale i need to set zoom value for camera.what value do i set for that and hw do i find that?Thanks
Bala beemaneni -
Is that needed ? Can't you directly use the pinch.scale to set the zoom ?
-
Every time pinch starts it resets to 1.So i used like
pinch.scale += pinch.previousScaleEven this does not give proper values as previousScale and scale are always equal.
-
Created the following sample, it zooms the camera as expected. Can you try it ?
@
Item {
width: Screen.width
height: Screen.heightCamera { id: camera imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash exposure { exposureCompensation: -1.0 exposureMode: Camera.ExposurePortrait } flash.mode: Camera.FlashRedEyeReduction } VideoOutput { source: camera anchors.fill: parent focus : visible // to receive focus and capture key events when visible } PinchArea { anchors.fill: parent pinch.minimumScale: 0.1 pinch.maximumScale: 1 onPinchUpdated: camera.setDigitalZoom(pinch.scale) }
}
@ -
Did u capture the image and check?
There is a marginal difference between the image captured and the amount of image zoomed for capture.. -
No i didn't as the question didn't say so. I thought you were struggling with the zooming using PinchArea and hence the above example. May be you should alter your question now ? Can you post what you have tried ?
-
Here the requirement goes as
I should start the camera and zoom in zoom out the source and capture the image.
my code is
@Camera {
id: cameraObj
captureMode: Camera.CaptureStillImageonDigitalZoomChanged: { pathText.text = cameraObj.digitalZoom.toString() } imageCapture { resolution: "960x1280" onImageCaptured: { // some stuff here } onImageSaved: { // similar } } VideoOutput { id: viewfinderBack source: cameraObj anchors.fill: parent autoOrientation: true focus: visible }
PinchArea {
id: pincharea
anchors.fill: parent
pinch.target: viewfinderBack
pinch.minimumScale: 1.0
pinch.maximumScale: 4.0 // max cam zoomonPinchStarted: { } onPinchUpdated: { // Here th code should find out whether user is scaled in or scaled out. cameraObj.setDigitalZoom(pinch.scale) }
}
@Hi check out this and let me know ..
-
Yes there's a difference in the captured image and that the VideoOutput shows. I also tried "this":http://qt-project.org/doc/qt-5/qtmultimedia-declarative-camera-example.html QML camera example it too does that same. Can you check it if it works for you ?
-
Hi thanks for ur interest..
I have seen that example already and they dont use pincharea for scale in and scale out.Instead they use mousearea .So that was not helpful as i tried implementing same logic to pincharea..
Thanks
Bala Beemaneni -
I wanted to say that in that example also even if you digital zoom to the max and take the picture the result is not the same as expected. May be this is a bug, not sure though.
-
oh that is weird...i have nt checked that..let me check and update you
Thanks
Bala Beemaneni -
Hi
it captures the accurate image only..the example is quite good enough.
As pinch and zoom is common in all mobiles now ,the logic should be pretty simple.Hope i am missing some basic stuff.
i am struggling with this for so long almost an month..Can i get any help other than qt forum ? can u suggest any?Thanks Bala Beemaneni
-
Since the example is working properly, can you check the following scenario ?
- from declarative-camera example, zoom to highest level and capture the pic.
- from your app, zoom to the highest level and capture the pic.
Compare these two pics if they are identical. Since both of them have set the digital zoom level to the highest which i assume is 4x, both captured pics must be identical.
-
Hi
I would like to tel u onething here...if i set the zoom level manually to 1 or 2 or ...4 it works same as the example model.Both pics are identical.But the problem here is we are not able to sink the scale in value to zoom value.the camera viewfinder value i.e: the visible portion of the screen and captured portion of an image are not equal.Hope u know this already..
Here wen i scale in ,based on scale portion zoom value has to be set.Thanks
-
bq. But the problem here is we are not able to sink the scale in value to zoom value
One way to check this would be to check what are the actual values that are passed to setDigitalZoom function in the declarative-camera example when one zoom's it using the slider. These values can then be checked with the values that you set to setDigitalZoom which you receive when you Pinch. May be there's a difference, a multiplication factor or something like that.
-
hi
i was trying the above method..it seems to be quite painful..But certainly there seems to be a multiplication factor .Meanwhile if u get any ideas please let me knowThanks