Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Camera preview image is always the same

$
0
0
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

Viewing all articles
Browse latest Browse all 4972

Trending Articles