Capture from the Device Camera

With the QML Multimedia components, you can access and capture from the device camera.

View the Device Camera Output

This example uses the Camera component to simply view the device camera output.

 import Felgo 3.0
 import QtQuick 2.0
 import QtMultimedia 5.9

 App {

   // Displays a title bar and is used for navigation between pages
   NavigationStack {

     Page {
       title: "Camera"

       Camera {
         id: camera

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

Capture Image from Device Camera

You can also use the Multimedia components components to capture images or videos from the camera. You can look at the CameraCapture components to find an example.

As a convenient alternative, Felgo also provides methods for this with the NativeUtils. This example opens the native camera dialog to take a picture.

 import Felgo 3.0
 import QtQuick 2.9

 App {
   id: app

   NavigationStack {

     Page {

       AppImage {
         id: image
         anchors.fill: parent
         // important to automatically rotate the image taken from the camera
         autoTransform: true
         fillMode: Image.PreserveAspectFit

       AppButton {
         anchors.centerIn: parent
         text: "Display CameraPicker"
         onClicked: {

       Connections {
         target: nativeUtils
         onCameraPickerFinished: {
           if(accepted) image.source = path

Scan a QR Code with the Camera

For QR Code scanning, we recommend this library:

We also used it in this open-source example app: Qt World Summit Conference App

More Frequently Asked Development Questions

Find more examples for frequently asked development questions and important concepts in the following guides:

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
create apps
create games
cross platform
native performance
3rd party services
game network
level editor
easiest to learn
biggest time saving
best support