Problem is reproduced with following qml code, executed on android 4.2.1.
To be added in .pro:
QT += core qml quick multimedia
Main.qml :
import QtQuick 2.3
import QtQuick.Window 2.2
import QtMultimedia 5.0
Window {
id: mainWindow
visible: true
Rectangle{
id: mainRectangle
anchors.fill: parent
MouseArea {
anchors.fill: parent
onClicked: {
if (mainRectangle.state === '') {
camera.imageCapture.capture();
}
else {
mainRectangle.state = '';
}
}
}
Camera {
id: camera
exposure.exposureMode: Camera.ExposureAuto
focus.focusMode: Camera.FocusContinuous
imageCapture {
onImageCaptured: {
photoPreview.source = preview;
mainRectangle.state = 'static';
}
}
}
VideoOutput {
id:videoOutput
anchors.fill: parent
source: camera
orientation: 270
visible : mainRectangle.state === ''
}
Image {
id: photoPreview
fillMode: Image.PreserveAspectFit
anchors.fill: parent
visible: mainRectangle.state === 'static'
cache: false
}
states: [
State {
name: "static"
}
]
}
}
First tap will display correct preview, but next ones will always display the same.
Help would really be appreciated !
Regards
MK
↧