QtOnAndroid

QML Camera

QML WebView Example | | QML Accelerometer Example

As another example, we create a simple QML camera, which shows a view finder, focuses on single click and captures images on double click:

import QtQuick 2.0
import QtMultimedia 5.3

Rectangle {
    width: 800
    height: 480

    Camera {
        id: camera
        videoRecorder {
            resolution: "800x480"
            frameRate: 30
        }
    }

    VideoOutput {
        anchors.fill: parent
        source: camera
        autoOrientation: true

        MouseArea {
            anchors.fill: parent;
            onClicked: camera.searchAndLock()
            onDoubleClicked: camera.imageCapture.capture()
        }
    }
}

Full source code:

svn co svn://schorsch.efi.fh-nuernberg.de/qt-android/simplecam


QML WebView Example | | QML Accelerometer Example

Options: