Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.0 Beta1
-
None
-
-
13d7f835fad59fbda69bfa160e21f19d095ac8d5
Description
Following QML code works correctly on android excepting rotation handling. Honestly i don't understand how it rotates preview image, sometime it shows it rotated on 90%, sometime on 180%, i didn't find any logic there:
import QtQuick 2.0
import QtQuick.Window 2.0
import QtMultimedia 5.0
Rectangle {
id : cameraUI
width: 800
height: 480
color: "black"
Camera {
id: camera
captureMode: Camera.CaptureVideo
focus.focusMode: Camera.FocusAuto
focus.focusPointMode: Camera.FocusPointCenter
onCameraStateChanged: {
if(camera.cameraState == Camera.ActiveState)
}
onLockStatusChanged: {
if(camera.lockStatus == Camera.Locked)
{ camera.searchAndLock(); }
}
}
VideoOutput {
id: viewfinder
anchors.fill: parent
fillMode: VideoOutput.PreserveAspectCrop
focus: visible
source: camera
Repeater {
model: camera.focus.focusZones
Rectangle {
border
color: "transparent"
property variant mappedRect: viewfinder.mapNormalizedRectToItem(area);
x: mappedRect.x
y: mappedRect.y
width: mappedRect.width
height: mappedRect.height
}
}
}
}