QML Camera ExampleThe Camera Example shows how to use the API to capture a still image or video. This example demonstrates the basic use of the Camera QML Plugin types. The plugin provides access to the API functionality for camera settings and capturing an image. Most of the QML code supports the user interface for this application with the camera types being mostly found in declarative-camera.qml and CaptureControls.qml. In declarative-camera.qml the Camera is initialized with an id of camera, a photo preview is setup, states are implemented for image preview or capture and CaptureControls is initialized. The initial state is PhotoCapture. CameraCapture includes a handler, onImageCaptured, for the imageCaptured signal. The handler sets up the application to process the preview including a change in the user interface state. The PhotoPreview becomes visible with any key press being picked up by the handler in PhotoPreview and returning the state to PhotoCapture. CaptureControls, which is implemented in CaptureControls.qml, generates a column on the right hand side of the screen which includes control buttons for focus (not initially visible), capture, flash modes, white balance, exposure compensation, and if a preview is available a preview button. The last button exits from the application. When the Capture button is pressed the onClicked handler calls captureImage() Files:
Images:
|